@sentio/runtime 2.57.10-rc.4 → 2.57.10
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.
- package/lib/chunk-BG3AVCAX.js +131 -0
- package/lib/{chunk-3P7ZNKVN.js.map → chunk-BG3AVCAX.js.map} +1 -1
- package/lib/index.d.ts +3 -6
- package/lib/index.js +1 -123
- package/lib/index.js.map +1 -1
- package/lib/processor-runner.js +57 -39447
- package/lib/processor-runner.js.map +1 -1
- package/package.json +1 -1
- package/src/gen/processor/protos/processor.ts +1 -17
- package/src/gen/service/common/protos/common.ts +60 -2
- package/src/metrics.ts +3 -5
- package/src/processor-runner.ts +25 -0
- package/lib/chunk-3P7ZNKVN.js +0 -80365
package/lib/index.d.ts
CHANGED
@@ -484,7 +484,6 @@ interface ExecutionConfig_DecoderWorkerConfig {
|
|
484
484
|
enabled: boolean;
|
485
485
|
workerCount?: number | undefined;
|
486
486
|
skipWhenDecodeFailed?: boolean | undefined;
|
487
|
-
recordTiming?: boolean | undefined;
|
488
487
|
}
|
489
488
|
declare const ExecutionConfig_DecoderWorkerConfig: {
|
490
489
|
encode(message: ExecutionConfig_DecoderWorkerConfig, writer?: _m0.Writer): _m0.Writer;
|
@@ -634,11 +633,10 @@ declare const processMetrics: {
|
|
634
633
|
processor_rpc_duration: H;
|
635
634
|
processor_rpc_queue_duration: H;
|
636
635
|
processor_template_instance_count: C;
|
637
|
-
processor_worker_run_time:
|
638
|
-
processor_worker_wait_time:
|
639
|
-
processor_worker_utilization: G;
|
636
|
+
processor_worker_run_time: C;
|
637
|
+
processor_worker_wait_time: C;
|
640
638
|
processor_worker_queue_size: G;
|
641
|
-
processor_worker_completed:
|
639
|
+
processor_worker_completed: C;
|
642
640
|
stats(): {
|
643
641
|
process_binding_count: number;
|
644
642
|
process_binding_time: number;
|
@@ -655,7 +653,6 @@ declare const processMetrics: {
|
|
655
653
|
processor_template_instance_count: number;
|
656
654
|
processor_worker_run_time: number;
|
657
655
|
processor_worker_wait_time: number;
|
658
|
-
processor_worker_utilization: number;
|
659
656
|
processor_worker_queue_size: number;
|
660
657
|
processor_worker_completed: number;
|
661
658
|
};
|
package/lib/index.js
CHANGED
@@ -1,125 +1,3 @@
|
|
1
1
|
import { createRequire as createRequireShim } from 'module'; const require = createRequireShim(import.meta.url);
|
2
|
-
import {
|
3
|
-
DummyProvider,
|
4
|
-
Endpoints,
|
5
|
-
GLOBAL_CONFIG,
|
6
|
-
Plugin,
|
7
|
-
PluginManager,
|
8
|
-
ProcessorServiceImpl,
|
9
|
-
QueuedStaticJsonRpcProvider,
|
10
|
-
StoreContext,
|
11
|
-
USER_PROCESSOR,
|
12
|
-
compareSemver,
|
13
|
-
dbMetrics,
|
14
|
-
errorString,
|
15
|
-
getProvider,
|
16
|
-
makeEthCallKey,
|
17
|
-
mergeProcessResults,
|
18
|
-
metricsStorage,
|
19
|
-
parseSemver,
|
20
|
-
processMetrics,
|
21
|
-
providerMetrics,
|
22
|
-
timeoutError
|
23
|
-
} from "./chunk-3P7ZNKVN.js";
|
24
|
-
|
25
|
-
// src/state.ts
|
26
|
-
var State = class _State {
|
27
|
-
stateMap = /* @__PURE__ */ new Map();
|
28
|
-
static INSTANCE = new _State();
|
29
|
-
static reset() {
|
30
|
-
_State.INSTANCE = new _State();
|
31
|
-
}
|
32
|
-
};
|
33
|
-
var StateStorage = class {
|
34
|
-
// TODO learn how to define single instance for all subclasses
|
35
|
-
constructor() {
|
36
|
-
}
|
37
|
-
key() {
|
38
|
-
return this.constructor.name;
|
39
|
-
}
|
40
|
-
getOrRegister() {
|
41
|
-
let metricState = State.INSTANCE.stateMap.get(this.key());
|
42
|
-
if (!metricState) {
|
43
|
-
metricState = this.initValue();
|
44
|
-
State.INSTANCE.stateMap.set(this.key(), metricState);
|
45
|
-
}
|
46
|
-
return metricState;
|
47
|
-
}
|
48
|
-
unregister() {
|
49
|
-
const value = State.INSTANCE.stateMap.get(this.key());
|
50
|
-
State.INSTANCE.stateMap.delete(this.key());
|
51
|
-
return value;
|
52
|
-
}
|
53
|
-
};
|
54
|
-
var MapStateStorage = class extends StateStorage {
|
55
|
-
initValue() {
|
56
|
-
return /* @__PURE__ */ new Map();
|
57
|
-
}
|
58
|
-
getValue(key) {
|
59
|
-
const m = this.getOrRegister();
|
60
|
-
return m.get(key);
|
61
|
-
}
|
62
|
-
getValues() {
|
63
|
-
const m = this.getOrRegister();
|
64
|
-
return Array.from(m.values());
|
65
|
-
}
|
66
|
-
getOrSetValue(key, value) {
|
67
|
-
const m = this.getOrRegister();
|
68
|
-
const oldValue = m.get(key);
|
69
|
-
if (oldValue) {
|
70
|
-
if (oldValue !== value) {
|
71
|
-
console.warn(key, "has been registered twice, use the previous one");
|
72
|
-
}
|
73
|
-
return oldValue;
|
74
|
-
}
|
75
|
-
m.set(key, value);
|
76
|
-
return value;
|
77
|
-
}
|
78
|
-
};
|
79
|
-
var ListStateStorage = class extends StateStorage {
|
80
|
-
initValue() {
|
81
|
-
return [];
|
82
|
-
}
|
83
|
-
getValues() {
|
84
|
-
return this.getOrRegister();
|
85
|
-
}
|
86
|
-
addValue(value) {
|
87
|
-
const m = this.getOrRegister();
|
88
|
-
m.push(value);
|
89
|
-
return value;
|
90
|
-
}
|
91
|
-
};
|
92
|
-
import("node:process").then((p) => p.stdout.write(""));
|
93
|
-
|
94
|
-
// src/chain-config.ts
|
95
|
-
import("node:process").then((p) => p.stdout.write(""));
|
96
|
-
|
97
|
-
// src/index.ts
|
98
|
-
import("node:process").then((p) => p.stdout.write(""));
|
99
|
-
export {
|
100
|
-
DummyProvider,
|
101
|
-
Endpoints,
|
102
|
-
GLOBAL_CONFIG,
|
103
|
-
ListStateStorage,
|
104
|
-
MapStateStorage,
|
105
|
-
Plugin,
|
106
|
-
PluginManager,
|
107
|
-
ProcessorServiceImpl,
|
108
|
-
QueuedStaticJsonRpcProvider,
|
109
|
-
State,
|
110
|
-
StateStorage,
|
111
|
-
StoreContext,
|
112
|
-
USER_PROCESSOR,
|
113
|
-
compareSemver,
|
114
|
-
dbMetrics,
|
115
|
-
errorString,
|
116
|
-
getProvider,
|
117
|
-
makeEthCallKey,
|
118
|
-
mergeProcessResults,
|
119
|
-
metricsStorage,
|
120
|
-
parseSemver,
|
121
|
-
processMetrics,
|
122
|
-
providerMetrics,
|
123
|
-
timeoutError
|
124
|
-
};
|
2
|
+
import{$ as O,A as p,X as N,Y as C,Z as V,_ as w,aa as A,ca as I,da as M,ea as b,fa as y,i as u,j as c,m as T,n as m,o as h,p as l,q as f,r as x,s as d}from"./chunk-BG3AVCAX.js";var r=class e{stateMap=new Map;static INSTANCE=new e;static reset(){e.INSTANCE=new e}},i=class{constructor(){}key(){return this.constructor.name}getOrRegister(){let t=r.INSTANCE.stateMap.get(this.key());return t||(t=this.initValue(),r.INSTANCE.stateMap.set(this.key(),t)),t}unregister(){let t=r.INSTANCE.stateMap.get(this.key());return r.INSTANCE.stateMap.delete(this.key()),t}},a=class extends i{initValue(){return new Map}getValue(t){return this.getOrRegister().get(t)}getValues(){let t=this.getOrRegister();return Array.from(t.values())}getOrSetValue(t,s){let o=this.getOrRegister(),n=o.get(t);return n?(n!==s&&console.warn(t,"has been registered twice, use the previous one"),n):(o.set(t,s),s)}},g=class extends i{initValue(){return[]}getValues(){return this.getOrRegister()}addValue(t){return this.getOrRegister().push(t),t}};import("node:process").then(e=>e.stdout.write(""));import("node:process").then(e=>e.stdout.write(""));import("node:process").then(e=>e.stdout.write(""));export{I as DummyProvider,d as Endpoints,p as GLOBAL_CONFIG,g as ListStateStorage,a as MapStateStorage,u as Plugin,c as PluginManager,y as ProcessorServiceImpl,b as QueuedStaticJsonRpcProvider,r as State,i as StateStorage,A as StoreContext,h as USER_PROCESSOR,x as compareSemver,N as dbMetrics,m as errorString,M as getProvider,l as makeEthCallKey,T as mergeProcessResults,w as metricsStorage,f as parseSemver,V as processMetrics,C as providerMetrics,O as timeoutError};
|
125
3
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/state.ts","../src/chain-config.ts","../src/index.ts"],"sourcesContent":["export class State {\n stateMap = new Map<string, any>()\n\n static INSTANCE = new State()\n\n static reset() {\n State.INSTANCE = new State()\n }\n}\n\nexport abstract class StateStorage<T> {\n // TODO learn how to define single instance for all subclasses\n\n protected constructor() {\n //\n }\n\n abstract initValue(): T\n\n key(): string {\n return this.constructor.name\n }\n\n getOrRegister(): T {\n let metricState: T = State.INSTANCE.stateMap.get(this.key())\n if (!metricState) {\n metricState = this.initValue()\n State.INSTANCE.stateMap.set(this.key(), metricState)\n }\n return metricState\n }\n\n unregister(): T {\n const value = State.INSTANCE.stateMap.get(this.key())\n State.INSTANCE.stateMap.delete(this.key())\n return value\n }\n}\n\nexport abstract class MapStateStorage<T> extends StateStorage<Map<string, T>> {\n initValue() {\n return new Map<string, T>()\n }\n\n getValue(key: string): T | undefined {\n const m = this.getOrRegister()\n return m.get(key)\n }\n\n getValues(): T[] {\n const m = this.getOrRegister()\n return Array.from(m.values())\n }\n\n getOrSetValue(key: string, value: T): T {\n const m = this.getOrRegister()\n const oldValue = m.get(key)\n if (oldValue) {\n if (oldValue !== value) {\n console.warn(key, 'has been registered twice, use the previous one')\n }\n return oldValue\n }\n m.set(key, value)\n return value\n }\n}\n\nexport abstract class ListStateStorage<T> extends StateStorage<T[]> {\n initValue() {\n return []\n }\n\n getValues(): T[] {\n return this.getOrRegister()\n }\n\n addValue(value: T): T {\n const m = this.getOrRegister()\n m.push(value)\n return value\n }\n}\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));","export interface ChainConfig {\n ChainID: string\n Https?: string[]\n ChainServer?: string\n}\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));","export * from './plugin.js'\nexport * from './state.js'\nexport * from './utils.js'\nexport * from './endpoints.js'\nexport * from './chain-config.js'\nexport * from './service.js'\nexport { GLOBAL_CONFIG, type GlobalConfig } from './global-config.js'\nexport * from './db-context.js'\nexport * from './provider.js'\nexport * from './metrics.js'\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));"],"mappings":"
|
1
|
+
{"version":3,"sources":["../src/state.ts","../src/chain-config.ts","../src/index.ts"],"sourcesContent":["export class State {\n stateMap = new Map<string, any>()\n\n static INSTANCE = new State()\n\n static reset() {\n State.INSTANCE = new State()\n }\n}\n\nexport abstract class StateStorage<T> {\n // TODO learn how to define single instance for all subclasses\n\n protected constructor() {\n //\n }\n\n abstract initValue(): T\n\n key(): string {\n return this.constructor.name\n }\n\n getOrRegister(): T {\n let metricState: T = State.INSTANCE.stateMap.get(this.key())\n if (!metricState) {\n metricState = this.initValue()\n State.INSTANCE.stateMap.set(this.key(), metricState)\n }\n return metricState\n }\n\n unregister(): T {\n const value = State.INSTANCE.stateMap.get(this.key())\n State.INSTANCE.stateMap.delete(this.key())\n return value\n }\n}\n\nexport abstract class MapStateStorage<T> extends StateStorage<Map<string, T>> {\n initValue() {\n return new Map<string, T>()\n }\n\n getValue(key: string): T | undefined {\n const m = this.getOrRegister()\n return m.get(key)\n }\n\n getValues(): T[] {\n const m = this.getOrRegister()\n return Array.from(m.values())\n }\n\n getOrSetValue(key: string, value: T): T {\n const m = this.getOrRegister()\n const oldValue = m.get(key)\n if (oldValue) {\n if (oldValue !== value) {\n console.warn(key, 'has been registered twice, use the previous one')\n }\n return oldValue\n }\n m.set(key, value)\n return value\n }\n}\n\nexport abstract class ListStateStorage<T> extends StateStorage<T[]> {\n initValue() {\n return []\n }\n\n getValues(): T[] {\n return this.getOrRegister()\n }\n\n addValue(value: T): T {\n const m = this.getOrRegister()\n m.push(value)\n return value\n }\n}\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));","export interface ChainConfig {\n ChainID: string\n Https?: string[]\n ChainServer?: string\n}\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));","export * from './plugin.js'\nexport * from './state.js'\nexport * from './utils.js'\nexport * from './endpoints.js'\nexport * from './chain-config.js'\nexport * from './service.js'\nexport { GLOBAL_CONFIG, type GlobalConfig } from './global-config.js'\nexport * from './db-context.js'\nexport * from './provider.js'\nexport * from './metrics.js'\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));"],"mappings":";kLAAO,IAAMA,EAAN,MAAMC,CAAM,CACjB,SAAW,IAAI,IAEf,OAAO,SAAW,IAAIA,EAEtB,OAAO,OAAQ,CACbA,EAAM,SAAW,IAAIA,CACvB,CACF,EAEsBC,EAAf,KAA+B,CAG1B,aAAc,CAExB,CAIA,KAAc,CACZ,OAAO,KAAK,YAAY,IAC1B,CAEA,eAAmB,CACjB,IAAIC,EAAiBH,EAAM,SAAS,SAAS,IAAI,KAAK,IAAI,CAAC,EAC3D,OAAKG,IACHA,EAAc,KAAK,UAAU,EAC7BH,EAAM,SAAS,SAAS,IAAI,KAAK,IAAI,EAAGG,CAAW,GAE9CA,CACT,CAEA,YAAgB,CACd,IAAMC,EAAQJ,EAAM,SAAS,SAAS,IAAI,KAAK,IAAI,CAAC,EACpD,OAAAA,EAAM,SAAS,SAAS,OAAO,KAAK,IAAI,CAAC,EAClCI,CACT,CACF,EAEsBC,EAAf,cAA0CH,CAA6B,CAC5E,WAAY,CACV,OAAO,IAAI,GACb,CAEA,SAASI,EAA4B,CAEnC,OADU,KAAK,cAAc,EACpB,IAAIA,CAAG,CAClB,CAEA,WAAiB,CACf,IAAMC,EAAI,KAAK,cAAc,EAC7B,OAAO,MAAM,KAAKA,EAAE,OAAO,CAAC,CAC9B,CAEA,cAAcD,EAAaF,EAAa,CACtC,IAAMG,EAAI,KAAK,cAAc,EACvBC,EAAWD,EAAE,IAAID,CAAG,EAC1B,OAAIE,GACEA,IAAaJ,GACf,QAAQ,KAAKE,EAAK,iDAAiD,EAE9DE,IAETD,EAAE,IAAID,EAAKF,CAAK,EACTA,EACT,CACF,EAEsBK,EAAf,cAA2CP,CAAkB,CAClE,WAAY,CACV,MAAO,CAAC,CACV,CAEA,WAAiB,CACf,OAAO,KAAK,cAAc,CAC5B,CAEA,SAASE,EAAa,CAEpB,OADU,KAAK,cAAc,EAC3B,KAAKA,CAAK,EACLA,CACT,CACF,EACC,OAAO,cAAc,EAAE,KAAMM,GAAMA,EAAE,OAAO,MAAM,EAAE,CAAC,EC9ErD,OAAO,cAAc,EAAE,KAAMC,GAAMA,EAAE,OAAO,MAAM,EAAE,CAAC,ECKrD,OAAO,cAAc,EAAE,KAAMC,GAAMA,EAAE,OAAO,MAAM,EAAE,CAAC","names":["State","_State","StateStorage","metricState","value","MapStateStorage","key","m","oldValue","ListStateStorage","p","p","p"]}
|