@sentio/runtime 2.40.0-rc.2 → 2.40.0-rc.4
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.
@@ -78261,6 +78261,7 @@ function getProvider2(chainId) {
|
|
78261
78261
|
const network = Network.from(parseInt(chainId));
|
78262
78262
|
const address = Endpoints.INSTANCE.chainServer.get(chainId);
|
78263
78263
|
const key = network.chainId.toString() + "-" + address;
|
78264
|
+
console.debug(`init provider for ${chainId}, address: ${address}`);
|
78264
78265
|
let provider = providers.get(key);
|
78265
78266
|
if (provider) {
|
78266
78267
|
return provider;
|
@@ -78442,7 +78443,7 @@ var ProcessorServiceImpl = class {
|
|
78442
78443
|
};
|
78443
78444
|
}
|
78444
78445
|
async preprocessBindings(bindings, dbContext, options) {
|
78445
|
-
console.log(
|
78446
|
+
console.log(`preprocessBindings start, bindings: ${bindings.length}`);
|
78446
78447
|
const promises = [];
|
78447
78448
|
for (const binding of bindings) {
|
78448
78449
|
promises.push(this.preprocessBinding(binding, dbContext, options));
|
@@ -78476,7 +78477,7 @@ var ProcessorServiceImpl = class {
|
|
78476
78477
|
for (const params of groupedRequests.values()) {
|
78477
78478
|
console.log(`chain: ${params[0].chainId}, address: ${params[0].address}, totalCalls: ${params.length}`);
|
78478
78479
|
for (const param of params) {
|
78479
|
-
const frag = new Interface(param.signature);
|
78480
|
+
const frag = new Interface([param.signature]);
|
78480
78481
|
const calldata = frag.encodeFunctionData(param.function, param.args);
|
78481
78482
|
callPromises.push(
|
78482
78483
|
providers2.get(param.chainId).call({
|
@@ -78486,7 +78487,12 @@ var ProcessorServiceImpl = class {
|
|
78486
78487
|
);
|
78487
78488
|
}
|
78488
78489
|
}
|
78489
|
-
|
78490
|
+
let results = {};
|
78491
|
+
try {
|
78492
|
+
results = Object.fromEntries(await Promise.all(callPromises));
|
78493
|
+
} catch (e) {
|
78494
|
+
console.error(`eth call error: ${e}`);
|
78495
|
+
}
|
78490
78496
|
console.log(`${callPromises.length} calls finished, elapsed: ${Date.now() - start}ms`);
|
78491
78497
|
return results;
|
78492
78498
|
}
|
package/lib/index.js
CHANGED
package/lib/processor-runner.js
CHANGED
package/package.json
CHANGED
package/src/provider.ts
CHANGED
@@ -37,6 +37,8 @@ export function getProvider(chainId?: EthChainId): Provider {
|
|
37
37
|
|
38
38
|
const address = Endpoints.INSTANCE.chainServer.get(chainId)
|
39
39
|
const key = network.chainId.toString() + '-' + address
|
40
|
+
|
41
|
+
console.debug(`init provider for ${chainId}, address: ${address}`)
|
40
42
|
let provider = providers.get(key)
|
41
43
|
|
42
44
|
if (provider) {
|
package/src/service.ts
CHANGED
@@ -160,7 +160,7 @@ export class ProcessorServiceImpl implements ProcessorServiceImplementation {
|
|
160
160
|
dbContext?: StoreContext,
|
161
161
|
options?: CallContext
|
162
162
|
): Promise<{ [calldata: string]: any[] }> {
|
163
|
-
console.log(
|
163
|
+
console.log(`preprocessBindings start, bindings: ${bindings.length}`)
|
164
164
|
const promises = []
|
165
165
|
for (const binding of bindings) {
|
166
166
|
promises.push(this.preprocessBinding(binding, dbContext, options))
|
@@ -195,7 +195,7 @@ export class ProcessorServiceImpl implements ProcessorServiceImplementation {
|
|
195
195
|
for (const params of groupedRequests.values()) {
|
196
196
|
console.log(`chain: ${params[0].chainId}, address: ${params[0].address}, totalCalls: ${params.length}`)
|
197
197
|
for (const param of params) {
|
198
|
-
const frag = new Interface(param.signature)
|
198
|
+
const frag = new Interface([param.signature])
|
199
199
|
const calldata = frag.encodeFunctionData(param.function, param.args)
|
200
200
|
callPromises.push(
|
201
201
|
providers
|
@@ -208,7 +208,12 @@ export class ProcessorServiceImpl implements ProcessorServiceImplementation {
|
|
208
208
|
)
|
209
209
|
}
|
210
210
|
}
|
211
|
-
|
211
|
+
let results = {}
|
212
|
+
try {
|
213
|
+
results = Object.fromEntries(await Promise.all(callPromises))
|
214
|
+
} catch (e) {
|
215
|
+
console.error(`eth call error: ${e}`)
|
216
|
+
}
|
212
217
|
console.log(`${callPromises.length} calls finished, elapsed: ${Date.now() - start}ms`)
|
213
218
|
return results
|
214
219
|
}
|