@sentio/runtime 2.61.0-rc.8 → 2.61.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,132 +1,4 @@
1
1
  import { createRequire as createRequireShim } from 'module'; const require = createRequireShim(import.meta.url);
2
- import {
3
- setupLogger
4
- } from "./chunk-2LXJZQSF.js";
5
- import {
6
- ProcessorServiceImpl,
7
- configureEndpoints,
8
- errorString,
9
- freezeGlobalConfig,
10
- require_cjs,
11
- require_lib3 as require_lib,
12
- require_lib4 as require_lib2
13
- } from "./chunk-XIU7XZT7.js";
14
- import {
15
- __toESM
16
- } from "./chunk-J4QKUO6L.js";
17
-
18
- // src/service-worker.ts
19
- var import_nice_grpc = __toESM(require_lib(), 1);
20
- var import_nice_grpc_error_details = __toESM(require_lib2(), 1);
21
- import { threadId } from "worker_threads";
22
- import { Piscina } from "piscina";
23
- var import_rxjs = __toESM(require_cjs(), 1);
24
- var started = false;
25
- var unhandled;
26
- process.on("uncaughtException", (err) => {
27
- console.error("Uncaught Exception, please checking if await is properly used", err);
28
- unhandled = err;
29
- }).on("unhandledRejection", (reason, p) => {
30
- if (reason?.message.startsWith('invalid ENS name (disallowed character: "*"')) {
31
- return;
32
- }
33
- console.error("Unhandled Rejection, please checking if await is properly", reason);
34
- unhandled = reason;
35
- }).on("exit", () => {
36
- console.info("Worker thread exiting, threadId:", threadId);
37
- });
38
- var service;
39
- var loader = async (options) => {
40
- if (options.target) {
41
- const m = await import(options.target);
42
- console.debug("Module loaded, path:", options.target, "module:", m);
43
- return m;
44
- }
45
- };
46
- var emptyCallContext = {};
47
- async function start(request, options) {
48
- if (started) {
49
- return {};
50
- }
51
- freezeGlobalConfig();
52
- try {
53
- service = new ProcessorServiceImpl(() => loader(options), options);
54
- } catch (e) {
55
- throw new import_nice_grpc.ServerError(import_nice_grpc.Status.INVALID_ARGUMENT, "Failed to load processor: " + errorString(e));
56
- }
57
- await service.start(request, emptyCallContext);
58
- started = true;
59
- return {};
60
- }
61
- async function service_worker_default({
62
- processId,
63
- request: firstRequest,
64
- workerPort
65
- }) {
66
- const { startRequest, configRequest, options } = Piscina.workerData;
67
- if (!started) {
68
- const logLevel = process.env["LOG_LEVEL"]?.toUpperCase();
69
- setupLogger(options["log-format"] === "json", logLevel === "debug" ? true : options.debug, threadId);
70
- configureEndpoints(options);
71
- if (startRequest) {
72
- await start(startRequest, options);
73
- console.debug("worker", threadId, " started, template instance:", startRequest.templateInstances?.length);
74
- }
75
- if (configRequest) {
76
- await service?.getConfig(configRequest, emptyCallContext);
77
- console.debug("worker", threadId, " configured");
78
- }
79
- }
80
- if (unhandled) {
81
- const err = unhandled;
82
- unhandled = void 0;
83
- console.error("Unhandled exception/rejection in previous request:", err);
84
- throw new import_nice_grpc_error_details.RichServerError(
85
- import_nice_grpc.Status.UNAVAILABLE,
86
- "Unhandled exception/rejection in previous request: " + errorString(err),
87
- [
88
- import_nice_grpc_error_details.DebugInfo.fromPartial({
89
- detail: err.message,
90
- stackEntries: err.stack?.split("\n")
91
- })
92
- ]
93
- );
94
- }
95
- const timeout = (options["worker-timeout"] || 0) * 1e3;
96
- const enablePartition = options["enable-partition"] || false;
97
- await new Promise((resolve, reject) => {
98
- const subject = new import_rxjs.Subject();
99
- let timeoutId = void 0;
100
- subject.subscribe((resp) => {
101
- console.debug("Worker", threadId, "send response:", resp.result ? "result" : "dbResult");
102
- workerPort.postMessage(resp);
103
- if (resp.result) {
104
- if (timeoutId) clearTimeout(timeoutId);
105
- resolve();
106
- workerPort.close();
107
- }
108
- });
109
- workerPort.on("message", (msg) => {
110
- const request = msg;
111
- console.debug("Worker", threadId, "received request:", request.start ? "start" : "dbResult");
112
- service?.handleRequest(request, firstRequest.binding, subject);
113
- if (enablePartition && request.start && timeout > 0) {
114
- timeoutId = setTimeout(async () => {
115
- reject(new import_nice_grpc_error_details.RichServerError(import_nice_grpc.Status.DEADLINE_EXCEEDED, "Worker timeout exceeded"));
116
- }, timeout);
117
- }
118
- });
119
- console.debug("Worker", threadId, "handle request: binding");
120
- service?.handleRequest(firstRequest, firstRequest.binding, subject);
121
- if (!enablePartition && timeout > 0) {
122
- timeoutId = setTimeout(() => {
123
- reject(new import_nice_grpc_error_details.RichServerError(import_nice_grpc.Status.DEADLINE_EXCEEDED, "Worker timeout exceeded"));
124
- }, timeout);
125
- }
126
- });
127
- }
128
- import("node:process").then((p) => p.stdout.write(""));
129
- export {
130
- service_worker_default as default
131
- };
2
+ import{a as k}from"./chunk-SAKSK7FD.js";import{Z as C,c as h,ca as I,j as R,p as x,q as y,u as q}from"./chunk-3P4VIZX3.js";import{e as E}from"./chunk-OMQ4A6ZL.js";var s=E(x(),1);var i=E(y(),1);import{threadId as o}from"worker_threads";import{Piscina as L}from"piscina";var D=E(C(),1),b=!1,u;process.on("uncaughtException",e=>{console.error("Uncaught Exception, please checking if await is properly used",e),u=e}).on("unhandledRejection",(e,t)=>{e?.message.startsWith('invalid ENS name (disallowed character: "*"')||(console.error("Unhandled Rejection, please checking if await is properly",e),u=e)}).on("exit",()=>{console.info("Worker thread exiting, threadId:",o)});var d,A=async e=>{if(e.target){let t=await import(e.target);return console.debug("Module loaded, path:",e.target,"module:",t),t}},v={};async function N(e,t){if(b)return{};q();try{d=new I(()=>A(t),t)}catch(a){throw new s.ServerError(s.Status.INVALID_ARGUMENT,"Failed to load processor: "+h(a))}return await d.start(e,v),b=!0,{}}async function z({processId:e,request:t,workerPort:a}){let{startRequest:p,configRequest:w,options:n}=L.workerData;if(!b){let r=process.env.LOG_LEVEL?.toUpperCase();k(n["log-format"]==="json",r==="debug"?!0:n.debug,o),R(n),p&&(await N(p,n),console.debug("worker",o," started, template instance:",p.templateInstances?.length)),w&&(await d?.getConfig(w,v),console.debug("worker",o," configured"))}if(u){let r=u;throw u=void 0,console.error("Unhandled exception/rejection in previous request:",r),new i.RichServerError(s.Status.UNAVAILABLE,"Unhandled exception/rejection in previous request: "+h(r),[i.DebugInfo.fromPartial({detail:r.message,stackEntries:r.stack?.split(`
3
+ `)})])}let l=(n["worker-timeout"]||0)*1e3,S=n["enable-partition"]||!1;await new Promise((r,P)=>{let f=new D.Subject,m;f.subscribe(c=>{console.debug("Worker",o,"send response:",c.result?"result":"dbResult"),a.postMessage(c),c.result&&(m&&clearTimeout(m),r(),a.close())}),a.on("message",c=>{let g=c;console.debug("Worker",o,"received request:",g.start?"start":"dbResult"),d?.handleRequest(g,t.binding,f),S&&g.start&&l>0&&(m=setTimeout(async()=>{P(new i.RichServerError(s.Status.DEADLINE_EXCEEDED,"Worker timeout exceeded"))},l))}),console.debug("Worker",o,"handle request: binding"),d?.handleRequest(t,t.binding,f),!S&&l>0&&(m=setTimeout(()=>{P(new i.RichServerError(s.Status.DEADLINE_EXCEEDED,"Worker timeout exceeded"))},l))})}import("node:process").then(e=>e.stdout.write(""));export{z as default};
132
4
  //# sourceMappingURL=service-worker.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/service-worker.ts"],"sourcesContent":["import { DeepPartial, Empty, ProcessStreamRequest, ProcessStreamResponse, StartRequest } from '@sentio/protos'\nimport { CallContext, ServerError, Status } from 'nice-grpc'\nimport { errorString } from './utils.js'\nimport { freezeGlobalConfig } from './global-config.js'\nimport { DebugInfo, RichServerError } from 'nice-grpc-error-details'\nimport { ProcessorServiceImpl } from './service.js'\nimport { MessagePort, threadId } from 'worker_threads'\nimport { Piscina } from 'piscina'\nimport { configureEndpoints } from './endpoints.js'\nimport { setupLogger } from './logger.js'\nimport { Subject } from 'rxjs'\n\nlet started = false\n\nlet unhandled: Error | undefined\n\nprocess\n .on('uncaughtException', (err) => {\n console.error('Uncaught Exception, please checking if await is properly used', err)\n unhandled = err\n })\n .on('unhandledRejection', (reason, p) => {\n // @ts-ignore ignore invalid ens error\n if (reason?.message.startsWith('invalid ENS name (disallowed character: \"*\"')) {\n return\n }\n console.error('Unhandled Rejection, please checking if await is properly', reason)\n unhandled = reason as Error\n // shutdownServers(1)\n })\n .on('exit', () => {\n console.info('Worker thread exiting, threadId:', threadId)\n })\n\nlet service: ProcessorServiceImpl | undefined\n\nconst loader = async (options: any) => {\n if (options.target) {\n const m = await import(options.target)\n console.debug('Module loaded, path:', options.target, 'module:', m)\n return m\n }\n}\n\nconst emptyCallContext = <CallContext>{}\n\nasync function start(request: StartRequest, options: any): Promise<Empty> {\n if (started) {\n return {}\n }\n freezeGlobalConfig()\n\n try {\n service = new ProcessorServiceImpl(() => loader(options), options)\n } catch (e) {\n throw new ServerError(Status.INVALID_ARGUMENT, 'Failed to load processor: ' + errorString(e))\n }\n\n await service.start(request, emptyCallContext)\n started = true\n return {}\n}\n\nexport default async function ({\n processId,\n request: firstRequest,\n workerPort\n}: {\n processId: number\n request: ProcessStreamRequest\n workerPort: MessagePort\n}) {\n const { startRequest, configRequest, options } = Piscina.workerData\n if (!started) {\n const logLevel = process.env['LOG_LEVEL']?.toUpperCase()\n setupLogger(options['log-format'] === 'json', logLevel === 'debug' ? true : options.debug, threadId)\n\n configureEndpoints(options)\n\n if (startRequest) {\n await start(startRequest, options)\n console.debug('worker', threadId, ' started, template instance:', startRequest.templateInstances?.length)\n }\n\n if (configRequest) {\n await service?.getConfig(configRequest, emptyCallContext)\n console.debug('worker', threadId, ' configured')\n }\n }\n\n if (unhandled) {\n const err = unhandled\n unhandled = undefined\n console.error('Unhandled exception/rejection in previous request:', err)\n throw new RichServerError(\n Status.UNAVAILABLE,\n 'Unhandled exception/rejection in previous request: ' + errorString(err),\n [\n DebugInfo.fromPartial({\n detail: err.message,\n stackEntries: err.stack?.split('\\n')\n })\n ]\n )\n }\n const timeout = (options['worker-timeout'] || 0) * 1000 // convert to milliseconds\n const enablePartition = options['enable-partition'] || false\n await new Promise<void>((resolve, reject) => {\n const subject = new Subject<DeepPartial<ProcessStreamResponse>>()\n let timeoutId: NodeJS.Timeout | undefined = undefined\n subject.subscribe((resp: ProcessStreamResponse) => {\n console.debug('Worker', threadId, 'send response:', resp.result ? 'result' : 'dbResult')\n workerPort.postMessage(resp)\n // receive the response from the processor , close and resolve the promise\n if (resp.result) {\n if (timeoutId) clearTimeout(timeoutId)\n resolve()\n workerPort.close()\n }\n })\n workerPort.on('message', (msg: ProcessStreamRequest) => {\n const request = msg as ProcessStreamRequest\n console.debug('Worker', threadId, 'received request:', request.start ? 'start' : 'dbResult')\n service?.handleRequest(request, firstRequest.binding, subject)\n if (enablePartition && request.start && timeout > 0) {\n timeoutId = setTimeout(async () => {\n reject(new RichServerError(Status.DEADLINE_EXCEEDED, 'Worker timeout exceeded'))\n }, timeout)\n }\n })\n console.debug('Worker', threadId, 'handle request: binding')\n service?.handleRequest(firstRequest, firstRequest.binding, subject)\n if (!enablePartition && timeout > 0) {\n timeoutId = setTimeout(() => {\n reject(new RichServerError(Status.DEADLINE_EXCEEDED, 'Worker timeout exceeded'))\n }, timeout)\n }\n })\n}\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));"],"mappings":";;;;;;;;;;;;;;;;;;AACA,uBAAiD;AAGjD,qCAA2C;AAE3C,SAAsB,gBAAgB;AACtC,SAAS,eAAe;AAGxB,kBAAwB;AAExB,IAAI,UAAU;AAEd,IAAI;AAEJ,QACG,GAAG,qBAAqB,CAAC,QAAQ;AAChC,UAAQ,MAAM,iEAAiE,GAAG;AAClF,cAAY;AACd,CAAC,EACA,GAAG,sBAAsB,CAAC,QAAQ,MAAM;AAEvC,MAAI,QAAQ,QAAQ,WAAW,6CAA6C,GAAG;AAC7E;AAAA,EACF;AACA,UAAQ,MAAM,6DAA6D,MAAM;AACjF,cAAY;AAEd,CAAC,EACA,GAAG,QAAQ,MAAM;AAChB,UAAQ,KAAK,oCAAoC,QAAQ;AAC3D,CAAC;AAEH,IAAI;AAEJ,IAAM,SAAS,OAAO,YAAiB;AACrC,MAAI,QAAQ,QAAQ;AAClB,UAAM,IAAI,MAAM,OAAO,QAAQ;AAC/B,YAAQ,MAAM,wBAAwB,QAAQ,QAAQ,WAAW,CAAC;AAClE,WAAO;AAAA,EACT;AACF;AAEA,IAAM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AAK;AACnD,QAAM,kBAAkB,QAAQ,kBAAkB,KAAK;AACvD,QAAM,IAAI,QAAc,CAAC,SAAS,WAAW;AAC3C,UAAM,UAAU,IAAI,oBAA4C;AAChE,QAAI,YAAwC;AAC5C,YAAQ,UAAU,CAAC,SAAgC;AACjD,cAAQ,MAAM,UAAU,UAAU,kBAAkB,KAAK,SAAS,WAAW,UAAU;AACvF,iBAAW,YAAY,IAAI;AAE3B,UAAI,KAAK,QAAQ;AACf,YAAI,UAAW,cAAa,SAAS;AACrC,gBAAQ;AACR,mBAAW,MAAM;AAAA,MACnB;AAAA,IACF,CAAC;AACD,eAAW,GAAG,WAAW,CAAC,QAA8B;AACtD,YAAM,UAAU;AAChB,cAAQ,MAAM,UAAU,UAAU,qBAAqB,QAAQ,QAAQ,UAAU,UAAU;AAC3F,eAAS,cAAc,SAAS,aAAa,SAAS,OAAO;AAC7D,UAAI,mBAAmB,QAAQ,SAAS,UAAU,GAAG;AACnD,oBAAY,WAAW,YAAY;AACjC,iBAAO,IAAI,+CAAgB,wBAAO,mBAAmB,yBAAyB,CAAC;AAAA,QACjF,GAAG,OAAO;AAAA,MACZ;AAAA,IACF,CAAC;AACD,YAAQ,MAAM,UAAU,UAAU,yBAAyB;AAC3D,aAAS,cAAc,cAAc,aAAa,SAAS,OAAO;AAClE,QAAI,CAAC,mBAAmB,UAAU,GAAG;AACnC,kBAAY,WAAW,MAAM;AAC3B,eAAO,IAAI,+CAAgB,wBAAO,mBAAmB,yBAAyB,CAAC;AAAA,MACjF,GAAG,OAAO;AAAA,IACZ;AAAA,EACF,CAAC;AACH;AACC,OAAO,cAAc,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,MAAM,EAAE,CAAC;","names":[]}
1
+ {"version":3,"sources":["../src/service-worker.ts"],"sourcesContent":["import { DeepPartial, Empty, ProcessStreamRequest, ProcessStreamResponse, StartRequest } from '@sentio/protos'\nimport { CallContext, ServerError, Status } from 'nice-grpc'\nimport { errorString } from './utils.js'\nimport { freezeGlobalConfig } from './global-config.js'\nimport { DebugInfo, RichServerError } from 'nice-grpc-error-details'\nimport { ProcessorServiceImpl } from './service.js'\nimport { MessagePort, threadId } from 'worker_threads'\nimport { Piscina } from 'piscina'\nimport { configureEndpoints } from './endpoints.js'\nimport { setupLogger } from './logger.js'\nimport { Subject } from 'rxjs'\n\nlet started = false\n\nlet unhandled: Error | undefined\n\nprocess\n .on('uncaughtException', (err) => {\n console.error('Uncaught Exception, please checking if await is properly used', err)\n unhandled = err\n })\n .on('unhandledRejection', (reason, p) => {\n // @ts-ignore ignore invalid ens error\n if (reason?.message.startsWith('invalid ENS name (disallowed character: \"*\"')) {\n return\n }\n console.error('Unhandled Rejection, please checking if await is properly', reason)\n unhandled = reason as Error\n // shutdownServers(1)\n })\n .on('exit', () => {\n console.info('Worker thread exiting, threadId:', threadId)\n })\n\nlet service: ProcessorServiceImpl | undefined\n\nconst loader = async (options: any) => {\n if (options.target) {\n const m = await import(options.target)\n console.debug('Module loaded, path:', options.target, 'module:', m)\n return m\n }\n}\n\nconst emptyCallContext = <CallContext>{}\n\nasync function start(request: StartRequest, options: any): Promise<Empty> {\n if (started) {\n return {}\n }\n freezeGlobalConfig()\n\n try {\n service = new ProcessorServiceImpl(() => loader(options), options)\n } catch (e) {\n throw new ServerError(Status.INVALID_ARGUMENT, 'Failed to load processor: ' + errorString(e))\n }\n\n await service.start(request, emptyCallContext)\n started = true\n return {}\n}\n\nexport default async function ({\n processId,\n request: firstRequest,\n workerPort\n}: {\n processId: number\n request: ProcessStreamRequest\n workerPort: MessagePort\n}) {\n const { startRequest, configRequest, options } = Piscina.workerData\n if (!started) {\n const logLevel = process.env['LOG_LEVEL']?.toUpperCase()\n setupLogger(options['log-format'] === 'json', logLevel === 'debug' ? true : options.debug, threadId)\n\n configureEndpoints(options)\n\n if (startRequest) {\n await start(startRequest, options)\n console.debug('worker', threadId, ' started, template instance:', startRequest.templateInstances?.length)\n }\n\n if (configRequest) {\n await service?.getConfig(configRequest, emptyCallContext)\n console.debug('worker', threadId, ' configured')\n }\n }\n\n if (unhandled) {\n const err = unhandled\n unhandled = undefined\n console.error('Unhandled exception/rejection in previous request:', err)\n throw new RichServerError(\n Status.UNAVAILABLE,\n 'Unhandled exception/rejection in previous request: ' + errorString(err),\n [\n DebugInfo.fromPartial({\n detail: err.message,\n stackEntries: err.stack?.split('\\n')\n })\n ]\n )\n }\n const timeout = (options['worker-timeout'] || 0) * 1000 // convert to milliseconds\n const enablePartition = options['enable-partition'] || false\n await new Promise<void>((resolve, reject) => {\n const subject = new Subject<DeepPartial<ProcessStreamResponse>>()\n let timeoutId: NodeJS.Timeout | undefined = undefined\n subject.subscribe((resp: ProcessStreamResponse) => {\n console.debug('Worker', threadId, 'send response:', resp.result ? 'result' : 'dbResult')\n workerPort.postMessage(resp)\n // receive the response from the processor , close and resolve the promise\n if (resp.result) {\n if (timeoutId) clearTimeout(timeoutId)\n resolve()\n workerPort.close()\n }\n })\n workerPort.on('message', (msg: ProcessStreamRequest) => {\n const request = msg as ProcessStreamRequest\n console.debug('Worker', threadId, 'received request:', request.start ? 'start' : 'dbResult')\n service?.handleRequest(request, firstRequest.binding, subject)\n if (enablePartition && request.start && timeout > 0) {\n timeoutId = setTimeout(async () => {\n reject(new RichServerError(Status.DEADLINE_EXCEEDED, 'Worker timeout exceeded'))\n }, timeout)\n }\n })\n console.debug('Worker', threadId, 'handle request: binding')\n service?.handleRequest(firstRequest, firstRequest.binding, subject)\n if (!enablePartition && timeout > 0) {\n timeoutId = setTimeout(() => {\n reject(new RichServerError(Status.DEADLINE_EXCEEDED, 'Worker timeout exceeded'))\n }, timeout)\n }\n })\n}\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));"],"mappings":";mKACA,IAAAA,EAAiD,SAGjD,IAAAC,EAA2C,SAE3C,OAAsB,YAAAC,MAAgB,iBACtC,OAAS,WAAAC,MAAe,UAGxB,IAAAC,EAAwB,SAEpBC,EAAU,GAEVC,EAEJ,QACG,GAAG,oBAAsBC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,yBAAyB,CAAC,CACjF,EAAGH,CAAO,EAEd,CAAC,CACH,CACC,OAAO,cAAc,EAAE,KAAMvB,GAAMA,EAAE,OAAO,MAAM,EAAE,CAAC","names":["import_nice_grpc","import_nice_grpc_error_details","threadId","Piscina","import_rxjs","started","unhandled","err","reason","p","threadId","service","loader","options","m","emptyCallContext","start","request","freezeGlobalConfig","ProcessorServiceImpl","e","errorString","service_worker_default","processId","firstRequest","workerPort","startRequest","configRequest","Piscina","logLevel","setupLogger","configureEndpoints","timeout","enablePartition","resolve","reject","subject","timeoutId","resp","msg"]}
@@ -1,4 +1,4 @@
1
- import { P as Plugin, c as DataBinding, d as ProcessResult, H as HandlerType } from './processor-Cbun9NKJ.js';
1
+ import { P as Plugin, c as DataBinding, d as ProcessResult, H as HandlerType } from './processor-DwZlMkFj.js';
2
2
  import { ProcessStreamResponse_Partitions, InitResponse, ProcessConfigResponse } from '@sentio/protos';
3
3
  import 'rxjs';
4
4
  import 'node:async_hooks';
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/test-processor.test.ts"],"sourcesContent":["import { Plugin, PluginManager } from './plugin.js'\nimport { DataBinding, HandlerType, ProcessResult } from './gen/processor/protos/processor.js'\nimport { AccountConfig, InitResponse, ProcessConfigResponse, ProcessStreamResponse_Partitions } from '@sentio/protos'\n\nexport class TestPlugin extends Plugin {\n async processBinding(request: DataBinding): Promise<ProcessResult> {\n const dbContext = PluginManager.INSTANCE.dbContextLocalStorage.getStore()\n if (dbContext) {\n await dbContext.sendRequest({\n get: {\n entity: 'Test',\n id: '1'\n }\n })\n }\n\n return ProcessResult.fromPartial({\n states: {\n configUpdated: true\n }\n })\n }\n supportedHandlers = [HandlerType.UNKNOWN, HandlerType.ETH_LOG]\n\n async partition(request: DataBinding): Promise<ProcessStreamResponse_Partitions> {\n return {\n partitions: request.handlerIds.reduce(\n (acc, id) => ({\n ...acc,\n [id]: {\n userValue: 'test'\n }\n }),\n {}\n )\n }\n }\n\n async init(config: InitResponse): Promise<void> {\n config.chainIds = ['1']\n }\n\n async configure(config: ProcessConfigResponse, forChainId?: string): Promise<void> {\n config.accountConfigs = [\n AccountConfig.fromPartial({\n address: '0x',\n chainId: '1'\n })\n ]\n }\n}\n\nPluginManager.INSTANCE.plugins = []\nPluginManager.INSTANCE.register(new TestPlugin())\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));"],"mappings":";;;;;;;;;AAIO,IAAM,aAAN,cAAyB,OAAO;AAAA,EACrC,MAAM,eAAe,SAA8C;AACjE,UAAM,YAAY,cAAc,SAAS,sBAAsB,SAAS;AACxE,QAAI,WAAW;AACb,YAAM,UAAU,YAAY;AAAA,QAC1B,KAAK;AAAA,UACH,QAAQ;AAAA,UACR,IAAI;AAAA,QACN;AAAA,MACF,CAAC;AAAA,IACH;AAEA,WAAO,cAAc,YAAY;AAAA,MAC/B,QAAQ;AAAA,QACN,eAAe;AAAA,MACjB;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EACA,oBAAoB,iCAAyC;AAAA,EAE7D,MAAM,UAAU,SAAiE;AAC/E,WAAO;AAAA,MACL,YAAY,QAAQ,WAAW;AAAA,QAC7B,CAAC,KAAK,QAAQ;AAAA,UACZ,GAAG;AAAA,UACH,CAAC,EAAE,GAAG;AAAA,YACJ,WAAW;AAAA,UACb;AAAA,QACF;AAAA,QACA,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AAAA,EAEA,MAAM,KAAK,QAAqC;AAC9C,WAAO,WAAW,CAAC,GAAG;AAAA,EACxB;AAAA,EAEA,MAAM,UAAU,QAA+B,YAAoC;AACjF,WAAO,iBAAiB;AAAA,MACtB,cAAc,YAAY;AAAA,QACxB,SAAS;AAAA,QACT,SAAS;AAAA,MACX,CAAC;AAAA,IACH;AAAA,EACF;AACF;AAEA,cAAc,SAAS,UAAU,CAAC;AAClC,cAAc,SAAS,SAAS,IAAI,WAAW,CAAC;AAC/C,OAAO,cAAc,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,MAAM,EAAE,CAAC;","names":[]}
1
+ {"version":3,"sources":["../src/test-processor.test.ts"],"sourcesContent":["import { Plugin, PluginManager } from './plugin.js'\nimport { DataBinding, HandlerType, ProcessResult } from './gen/processor/protos/processor.js'\nimport { AccountConfig, InitResponse, ProcessConfigResponse, ProcessStreamResponse_Partitions } from '@sentio/protos'\n\nexport class TestPlugin extends Plugin {\n async processBinding(request: DataBinding): Promise<ProcessResult> {\n const dbContext = PluginManager.INSTANCE.dbContextLocalStorage.getStore()\n if (dbContext) {\n await dbContext.sendRequest({\n get: {\n entity: 'Test',\n id: '1'\n }\n })\n }\n\n return ProcessResult.fromPartial({\n states: {\n configUpdated: true\n }\n })\n }\n supportedHandlers = [HandlerType.UNKNOWN, HandlerType.ETH_LOG]\n\n async partition(request: DataBinding): Promise<ProcessStreamResponse_Partitions> {\n return {\n partitions: request.handlerIds.reduce(\n (acc, id) => ({\n ...acc,\n [id]: {\n userValue: 'test'\n }\n }),\n {}\n )\n }\n }\n\n async init(config: InitResponse): Promise<void> {\n config.chainIds = ['1']\n }\n\n async configure(config: ProcessConfigResponse, forChainId?: string): Promise<void> {\n config.accountConfigs = [\n AccountConfig.fromPartial({\n address: '0x',\n chainId: '1'\n })\n ]\n }\n}\n\nPluginManager.INSTANCE.plugins = []\nPluginManager.INSTANCE.register(new TestPlugin())\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));"],"mappings":";6DAIO,IAAMA,EAAN,cAAyBC,CAAO,CACrC,MAAM,eAAeC,EAA8C,CACjE,IAAMC,EAAYC,EAAc,SAAS,sBAAsB,SAAS,EACxE,OAAID,GACF,MAAMA,EAAU,YAAY,CAC1B,IAAK,CACH,OAAQ,OACR,GAAI,GACN,CACF,CAAC,EAGIE,EAAc,YAAY,CAC/B,OAAQ,CACN,cAAe,EACjB,CACF,CAAC,CACH,CACA,kBAAoB,IAAyC,EAE7D,MAAM,UAAUH,EAAiE,CAC/E,MAAO,CACL,WAAYA,EAAQ,WAAW,OAC7B,CAACI,EAAKC,KAAQ,CACZ,GAAGD,EACH,CAACC,CAAE,EAAG,CACJ,UAAW,MACb,CACF,GACA,CAAC,CACH,CACF,CACF,CAEA,MAAM,KAAKC,EAAqC,CAC9CA,EAAO,SAAW,CAAC,GAAG,CACxB,CAEA,MAAM,UAAUA,EAA+BC,EAAoC,CACjFD,EAAO,eAAiB,CACtBE,EAAc,YAAY,CACxB,QAAS,KACT,QAAS,GACX,CAAC,CACH,CACF,CACF,EAEAN,EAAc,SAAS,QAAU,CAAC,EAClCA,EAAc,SAAS,SAAS,IAAIJ,CAAY,EAC/C,OAAO,cAAc,EAAE,KAAMW,GAAMA,EAAE,OAAO,MAAM,EAAE,CAAC","names":["TestPlugin","Plugin","request","dbContext","PluginManager","ProcessResult","acc","id","config","forChainId","AccountConfig","p"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentio/runtime",
3
- "version": "2.61.0-rc.8",
3
+ "version": "2.61.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
package/src/db-context.ts CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  DeepPartial,
7
7
  ProcessResult,
8
8
  ProcessStreamResponse,
9
- ProcessStreamResponseV2,
9
+ ProcessStreamResponseV3,
10
10
  TemplateInstance,
11
11
  TimeseriesResult
12
12
  } from '@sentio/protos'
@@ -257,7 +257,7 @@ export class StoreContext extends AbstractStoreContext {
257
257
  export class DataBindingContext extends AbstractStoreContext implements IDataBindingContext {
258
258
  constructor(
259
259
  readonly processId: number,
260
- readonly subject: Subject<DeepPartial<ProcessStreamResponseV2>>
260
+ readonly subject: Subject<DeepPartial<ProcessStreamResponseV3>>
261
261
  ) {
262
262
  super(processId)
263
263
  }
@@ -279,7 +279,7 @@ export class DataBindingContext extends AbstractStoreContext implements IDataBin
279
279
  })
280
280
  }
281
281
 
282
- doSend(resp: DeepPartial<ProcessStreamResponseV2>) {
282
+ doSend(resp: DeepPartial<ProcessStreamResponseV3>) {
283
283
  console.debug('sending db request, processId ', this.processId, 'opId', resp.dbRequest?.opId)
284
284
  this.subject.next({
285
285
  ...resp,
@@ -2,11 +2,9 @@ import { CallContext } from 'nice-grpc'
2
2
  import { createRequire } from 'module'
3
3
  // Different than the simple one which
4
4
  import {
5
- ConfigureHandlersRequest,
6
5
  DataBinding,
7
6
  ExecutionConfig,
8
7
  HandlerType,
9
- InitResponse,
10
8
  PreprocessStreamRequest,
11
9
  ProcessBindingsRequest,
12
10
  ProcessConfigRequest,
@@ -17,7 +15,7 @@ import {
17
15
  StartRequest
18
16
  } from './gen/processor/protos/processor.js'
19
17
 
20
- import { ConfigureHandlersResponse, DeepPartial, Empty, ProcessorV3ServiceImplementation } from '@sentio/protos'
18
+ import { DeepPartial, Empty, ProcessorV3ServiceImplementation, UpdateTemplatesRequest } from '@sentio/protos'
21
19
  import fs from 'fs-extra'
22
20
  import path from 'path'
23
21
  import os from 'os'
@@ -415,17 +413,12 @@ export class FullProcessorServiceV3Impl implements ProcessorV3ServiceImplementat
415
413
 
416
414
  constructor(readonly instance: ProcessorV3ServiceImplementation) {}
417
415
 
418
- async init(request: Empty, context: CallContext): Promise<DeepPartial<InitResponse>> {
419
- const resp = await this.instance.init(request, context)
420
- resp.executionConfig = ExecutionConfig.fromPartial(GLOBAL_CONFIG.execution)
421
- return resp
416
+ async start(request: StartRequest, context: CallContext): Promise<DeepPartial<Empty>> {
417
+ return this.instance.start(request, context)
422
418
  }
423
419
 
424
- async configureHandlers(
425
- request: ConfigureHandlersRequest,
426
- context: CallContext
427
- ): Promise<DeepPartial<ConfigureHandlersResponse>> {
428
- const config = await this.instance.configureHandlers(request, context)
420
+ async getConfig(request: ProcessConfigRequest, context: CallContext): Promise<DeepPartial<ProcessConfigResponse>> {
421
+ const config = await this.instance.getConfig(request, context)
429
422
  this.patcher.patchConfig(config)
430
423
  return config
431
424
  }
@@ -440,4 +433,8 @@ export class FullProcessorServiceV3Impl implements ProcessorV3ServiceImplementat
440
433
  yield request
441
434
  }
442
435
  }
436
+
437
+ async updateTemplates(request: UpdateTemplatesRequest, context: CallContext): Promise<DeepPartial<Empty>> {
438
+ return this.instance.updateTemplates(request, context)
439
+ }
443
440
  }
@@ -680,7 +680,7 @@ export interface InitResponse {
680
680
  eventLogConfigs: EventLogConfig[];
681
681
  }
682
682
 
683
- export interface ConfigureHandlersRequest {
683
+ export interface UpdateTemplatesRequest {
684
684
  chainId: string;
685
685
  templateInstances: TemplateInstance[];
686
686
  }
@@ -999,7 +999,7 @@ export interface ProcessStreamResponse_Partitions_PartitionsEntry {
999
999
  value: ProcessStreamResponse_Partitions_Partition | undefined;
1000
1000
  }
1001
1001
 
1002
- export interface ProcessStreamResponseV2 {
1002
+ export interface ProcessStreamResponseV3 {
1003
1003
  processId: number;
1004
1004
  partitions?: ProcessStreamResponse_Partitions | undefined;
1005
1005
  dbRequest?: DBRequest | undefined;
@@ -4662,12 +4662,12 @@ export const InitResponse = {
4662
4662
  },
4663
4663
  };
4664
4664
 
4665
- function createBaseConfigureHandlersRequest(): ConfigureHandlersRequest {
4665
+ function createBaseUpdateTemplatesRequest(): UpdateTemplatesRequest {
4666
4666
  return { chainId: "", templateInstances: [] };
4667
4667
  }
4668
4668
 
4669
- export const ConfigureHandlersRequest = {
4670
- encode(message: ConfigureHandlersRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
4669
+ export const UpdateTemplatesRequest = {
4670
+ encode(message: UpdateTemplatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
4671
4671
  if (message.chainId !== "") {
4672
4672
  writer.uint32(10).string(message.chainId);
4673
4673
  }
@@ -4677,10 +4677,10 @@ export const ConfigureHandlersRequest = {
4677
4677
  return writer;
4678
4678
  },
4679
4679
 
4680
- decode(input: _m0.Reader | Uint8Array, length?: number): ConfigureHandlersRequest {
4680
+ decode(input: _m0.Reader | Uint8Array, length?: number): UpdateTemplatesRequest {
4681
4681
  const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
4682
4682
  let end = length === undefined ? reader.len : reader.pos + length;
4683
- const message = createBaseConfigureHandlersRequest();
4683
+ const message = createBaseUpdateTemplatesRequest();
4684
4684
  while (reader.pos < end) {
4685
4685
  const tag = reader.uint32();
4686
4686
  switch (tag >>> 3) {
@@ -4707,7 +4707,7 @@ export const ConfigureHandlersRequest = {
4707
4707
  return message;
4708
4708
  },
4709
4709
 
4710
- fromJSON(object: any): ConfigureHandlersRequest {
4710
+ fromJSON(object: any): UpdateTemplatesRequest {
4711
4711
  return {
4712
4712
  chainId: isSet(object.chainId) ? globalThis.String(object.chainId) : "",
4713
4713
  templateInstances: globalThis.Array.isArray(object?.templateInstances)
@@ -4716,7 +4716,7 @@ export const ConfigureHandlersRequest = {
4716
4716
  };
4717
4717
  },
4718
4718
 
4719
- toJSON(message: ConfigureHandlersRequest): unknown {
4719
+ toJSON(message: UpdateTemplatesRequest): unknown {
4720
4720
  const obj: any = {};
4721
4721
  if (message.chainId !== "") {
4722
4722
  obj.chainId = message.chainId;
@@ -4727,11 +4727,11 @@ export const ConfigureHandlersRequest = {
4727
4727
  return obj;
4728
4728
  },
4729
4729
 
4730
- create(base?: DeepPartial<ConfigureHandlersRequest>): ConfigureHandlersRequest {
4731
- return ConfigureHandlersRequest.fromPartial(base ?? {});
4730
+ create(base?: DeepPartial<UpdateTemplatesRequest>): UpdateTemplatesRequest {
4731
+ return UpdateTemplatesRequest.fromPartial(base ?? {});
4732
4732
  },
4733
- fromPartial(object: DeepPartial<ConfigureHandlersRequest>): ConfigureHandlersRequest {
4734
- const message = createBaseConfigureHandlersRequest();
4733
+ fromPartial(object: DeepPartial<UpdateTemplatesRequest>): UpdateTemplatesRequest {
4734
+ const message = createBaseUpdateTemplatesRequest();
4735
4735
  message.chainId = object.chainId ?? "";
4736
4736
  message.templateInstances = object.templateInstances?.map((e) => TemplateInstance.fromPartial(e)) || [];
4737
4737
  return message;
@@ -8881,7 +8881,7 @@ export const ProcessStreamResponse_Partitions_PartitionsEntry = {
8881
8881
  },
8882
8882
  };
8883
8883
 
8884
- function createBaseProcessStreamResponseV2(): ProcessStreamResponseV2 {
8884
+ function createBaseProcessStreamResponseV3(): ProcessStreamResponseV3 {
8885
8885
  return {
8886
8886
  processId: 0,
8887
8887
  partitions: undefined,
@@ -8892,8 +8892,8 @@ function createBaseProcessStreamResponseV2(): ProcessStreamResponseV2 {
8892
8892
  };
8893
8893
  }
8894
8894
 
8895
- export const ProcessStreamResponseV2 = {
8896
- encode(message: ProcessStreamResponseV2, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
8895
+ export const ProcessStreamResponseV3 = {
8896
+ encode(message: ProcessStreamResponseV3, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
8897
8897
  if (message.processId !== 0) {
8898
8898
  writer.uint32(8).int32(message.processId);
8899
8899
  }
@@ -8915,10 +8915,10 @@ export const ProcessStreamResponseV2 = {
8915
8915
  return writer;
8916
8916
  },
8917
8917
 
8918
- decode(input: _m0.Reader | Uint8Array, length?: number): ProcessStreamResponseV2 {
8918
+ decode(input: _m0.Reader | Uint8Array, length?: number): ProcessStreamResponseV3 {
8919
8919
  const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
8920
8920
  let end = length === undefined ? reader.len : reader.pos + length;
8921
- const message = createBaseProcessStreamResponseV2();
8921
+ const message = createBaseProcessStreamResponseV3();
8922
8922
  while (reader.pos < end) {
8923
8923
  const tag = reader.uint32();
8924
8924
  switch (tag >>> 3) {
@@ -8973,7 +8973,7 @@ export const ProcessStreamResponseV2 = {
8973
8973
  return message;
8974
8974
  },
8975
8975
 
8976
- fromJSON(object: any): ProcessStreamResponseV2 {
8976
+ fromJSON(object: any): ProcessStreamResponseV3 {
8977
8977
  return {
8978
8978
  processId: isSet(object.processId) ? globalThis.Number(object.processId) : 0,
8979
8979
  partitions: isSet(object.partitions) ? ProcessStreamResponse_Partitions.fromJSON(object.partitions) : undefined,
@@ -8984,7 +8984,7 @@ export const ProcessStreamResponseV2 = {
8984
8984
  };
8985
8985
  },
8986
8986
 
8987
- toJSON(message: ProcessStreamResponseV2): unknown {
8987
+ toJSON(message: ProcessStreamResponseV3): unknown {
8988
8988
  const obj: any = {};
8989
8989
  if (message.processId !== 0) {
8990
8990
  obj.processId = Math.round(message.processId);
@@ -9007,11 +9007,11 @@ export const ProcessStreamResponseV2 = {
9007
9007
  return obj;
9008
9008
  },
9009
9009
 
9010
- create(base?: DeepPartial<ProcessStreamResponseV2>): ProcessStreamResponseV2 {
9011
- return ProcessStreamResponseV2.fromPartial(base ?? {});
9010
+ create(base?: DeepPartial<ProcessStreamResponseV3>): ProcessStreamResponseV3 {
9011
+ return ProcessStreamResponseV3.fromPartial(base ?? {});
9012
9012
  },
9013
- fromPartial(object: DeepPartial<ProcessStreamResponseV2>): ProcessStreamResponseV2 {
9014
- const message = createBaseProcessStreamResponseV2();
9013
+ fromPartial(object: DeepPartial<ProcessStreamResponseV3>): ProcessStreamResponseV3 {
9014
+ const message = createBaseProcessStreamResponseV3();
9015
9015
  message.processId = object.processId ?? 0;
9016
9016
  message.partitions = (object.partitions !== undefined && object.partitions !== null)
9017
9017
  ? ProcessStreamResponse_Partitions.fromPartial(object.partitions)
@@ -15196,19 +15196,27 @@ export const ProcessorV3Definition = {
15196
15196
  name: "ProcessorV3",
15197
15197
  fullName: "processor.ProcessorV3",
15198
15198
  methods: {
15199
- init: {
15200
- name: "Init",
15201
- requestType: Empty,
15199
+ start: {
15200
+ name: "Start",
15201
+ requestType: StartRequest,
15202
+ requestStream: false,
15203
+ responseType: Empty,
15204
+ responseStream: false,
15205
+ options: {},
15206
+ },
15207
+ getConfig: {
15208
+ name: "GetConfig",
15209
+ requestType: ProcessConfigRequest,
15202
15210
  requestStream: false,
15203
- responseType: InitResponse,
15211
+ responseType: ProcessConfigResponse,
15204
15212
  responseStream: false,
15205
15213
  options: {},
15206
15214
  },
15207
- configureHandlers: {
15208
- name: "ConfigureHandlers",
15209
- requestType: ConfigureHandlersRequest,
15215
+ updateTemplates: {
15216
+ name: "UpdateTemplates",
15217
+ requestType: UpdateTemplatesRequest,
15210
15218
  requestStream: false,
15211
- responseType: ConfigureHandlersResponse,
15219
+ responseType: Empty,
15212
15220
  responseStream: false,
15213
15221
  options: {},
15214
15222
  },
@@ -15216,7 +15224,7 @@ export const ProcessorV3Definition = {
15216
15224
  name: "ProcessBindingsStream",
15217
15225
  requestType: ProcessStreamRequest,
15218
15226
  requestStream: true,
15219
- responseType: ProcessStreamResponseV2,
15227
+ responseType: ProcessStreamResponseV3,
15220
15228
  responseStream: true,
15221
15229
  options: {},
15222
15230
  },
@@ -15224,27 +15232,29 @@ export const ProcessorV3Definition = {
15224
15232
  } as const;
15225
15233
 
15226
15234
  export interface ProcessorV3ServiceImplementation<CallContextExt = {}> {
15227
- init(request: Empty, context: CallContext & CallContextExt): Promise<DeepPartial<InitResponse>>;
15228
- configureHandlers(
15229
- request: ConfigureHandlersRequest,
15235
+ start(request: StartRequest, context: CallContext & CallContextExt): Promise<DeepPartial<Empty>>;
15236
+ getConfig(
15237
+ request: ProcessConfigRequest,
15230
15238
  context: CallContext & CallContextExt,
15231
- ): Promise<DeepPartial<ConfigureHandlersResponse>>;
15239
+ ): Promise<DeepPartial<ProcessConfigResponse>>;
15240
+ updateTemplates(request: UpdateTemplatesRequest, context: CallContext & CallContextExt): Promise<DeepPartial<Empty>>;
15232
15241
  processBindingsStream(
15233
15242
  request: AsyncIterable<ProcessStreamRequest>,
15234
15243
  context: CallContext & CallContextExt,
15235
- ): ServerStreamingMethodResult<DeepPartial<ProcessStreamResponseV2>>;
15244
+ ): ServerStreamingMethodResult<DeepPartial<ProcessStreamResponseV3>>;
15236
15245
  }
15237
15246
 
15238
15247
  export interface ProcessorV3Client<CallOptionsExt = {}> {
15239
- init(request: DeepPartial<Empty>, options?: CallOptions & CallOptionsExt): Promise<InitResponse>;
15240
- configureHandlers(
15241
- request: DeepPartial<ConfigureHandlersRequest>,
15248
+ start(request: DeepPartial<StartRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
15249
+ getConfig(
15250
+ request: DeepPartial<ProcessConfigRequest>,
15242
15251
  options?: CallOptions & CallOptionsExt,
15243
- ): Promise<ConfigureHandlersResponse>;
15252
+ ): Promise<ProcessConfigResponse>;
15253
+ updateTemplates(request: DeepPartial<UpdateTemplatesRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
15244
15254
  processBindingsStream(
15245
15255
  request: AsyncIterable<DeepPartial<ProcessStreamRequest>>,
15246
15256
  options?: CallOptions & CallOptionsExt,
15247
- ): AsyncIterable<ProcessStreamResponseV2>;
15257
+ ): AsyncIterable<ProcessStreamResponseV3>;
15248
15258
  }
15249
15259
 
15250
15260
  type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
@@ -2116,6 +2116,9 @@ export interface RequestLog {
2116
2116
  queryDuration: bigint;
2117
2117
  method: string;
2118
2118
  rpcNodeId: string;
2119
+ originUrl: string;
2120
+ endpointType: string;
2121
+ chainId: string;
2119
2122
  }
2120
2123
 
2121
2124
  function createBaseUsageTracker(): UsageTracker {
@@ -14903,6 +14906,9 @@ function createBaseRequestLog(): RequestLog {
14903
14906
  queryDuration: BigInt("0"),
14904
14907
  method: "",
14905
14908
  rpcNodeId: "",
14909
+ originUrl: "",
14910
+ endpointType: "",
14911
+ chainId: "",
14906
14912
  };
14907
14913
  }
14908
14914
 
@@ -14959,6 +14965,15 @@ export const RequestLog = {
14959
14965
  if (message.rpcNodeId !== "") {
14960
14966
  writer.uint32(122).string(message.rpcNodeId);
14961
14967
  }
14968
+ if (message.originUrl !== "") {
14969
+ writer.uint32(130).string(message.originUrl);
14970
+ }
14971
+ if (message.endpointType !== "") {
14972
+ writer.uint32(138).string(message.endpointType);
14973
+ }
14974
+ if (message.chainId !== "") {
14975
+ writer.uint32(146).string(message.chainId);
14976
+ }
14962
14977
  return writer;
14963
14978
  },
14964
14979
 
@@ -15074,6 +15089,27 @@ export const RequestLog = {
15074
15089
 
15075
15090
  message.rpcNodeId = reader.string();
15076
15091
  continue;
15092
+ case 16:
15093
+ if (tag !== 130) {
15094
+ break;
15095
+ }
15096
+
15097
+ message.originUrl = reader.string();
15098
+ continue;
15099
+ case 17:
15100
+ if (tag !== 138) {
15101
+ break;
15102
+ }
15103
+
15104
+ message.endpointType = reader.string();
15105
+ continue;
15106
+ case 18:
15107
+ if (tag !== 146) {
15108
+ break;
15109
+ }
15110
+
15111
+ message.chainId = reader.string();
15112
+ continue;
15077
15113
  }
15078
15114
  if ((tag & 7) === 4 || tag === 0) {
15079
15115
  break;
@@ -15100,6 +15136,9 @@ export const RequestLog = {
15100
15136
  queryDuration: isSet(object.queryDuration) ? BigInt(object.queryDuration) : BigInt("0"),
15101
15137
  method: isSet(object.method) ? globalThis.String(object.method) : "",
15102
15138
  rpcNodeId: isSet(object.rpcNodeId) ? globalThis.String(object.rpcNodeId) : "",
15139
+ originUrl: isSet(object.originUrl) ? globalThis.String(object.originUrl) : "",
15140
+ endpointType: isSet(object.endpointType) ? globalThis.String(object.endpointType) : "",
15141
+ chainId: isSet(object.chainId) ? globalThis.String(object.chainId) : "",
15103
15142
  };
15104
15143
  },
15105
15144
 
@@ -15150,6 +15189,15 @@ export const RequestLog = {
15150
15189
  if (message.rpcNodeId !== "") {
15151
15190
  obj.rpcNodeId = message.rpcNodeId;
15152
15191
  }
15192
+ if (message.originUrl !== "") {
15193
+ obj.originUrl = message.originUrl;
15194
+ }
15195
+ if (message.endpointType !== "") {
15196
+ obj.endpointType = message.endpointType;
15197
+ }
15198
+ if (message.chainId !== "") {
15199
+ obj.chainId = message.chainId;
15200
+ }
15153
15201
  return obj;
15154
15202
  },
15155
15203
 
@@ -15173,6 +15221,9 @@ export const RequestLog = {
15173
15221
  message.queryDuration = object.queryDuration ?? BigInt("0");
15174
15222
  message.method = object.method ?? "";
15175
15223
  message.rpcNodeId = object.rpcNodeId ?? "";
15224
+ message.originUrl = object.originUrl ?? "";
15225
+ message.endpointType = object.endpointType ?? "";
15226
+ message.chainId = object.chainId ?? "";
15176
15227
  return message;
15177
15228
  },
15178
15229
  };