Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
belopash committed Jan 27, 2025
1 parent 5396d88 commit d212036
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 34 deletions.
68 changes: 34 additions & 34 deletions evm/evm-processor/src/processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -596,40 +596,40 @@ export class EvmBatchProcessor<F extends FieldSelection = {}> {
let log = this.getLogger()

runProgram(async () => {
let chain = this.getChain()
let mappingLog = log.child('mapping')

if (this.archive == null && this.rpcEndpoint == null) {
throw new Error(
'No data source where specified. ' +
'Use .setArchive() to specify Subsquid Archive and/or .setRpcEndpoint() to specify RPC endpoint.'
)
}

if (this.archive == null && this.rpcIngestSettings?.disabled) {
throw new Error('Subsquid Archive is required when RPC data ingestion is disabled')
}

return new Runner({
database,
requests: this.getBatchRequests(),
archive: this.archive ? this.getArchiveDataSource() : undefined,
hotDataSource: this.rpcEndpoint && !this.rpcIngestSettings?.disabled
? this.getHotDataSource()
: undefined,
allBlocksAreFinal: this.finalityConfirmation === 0,
prometheus: this.getPrometheusServer(),
log,
process(store, batch) {
return handler({
_chain: chain,
log: mappingLog,
store,
blocks: batch.blocks as any,
isHead: batch.isHead
})
}
}).run()
let chain = this.getChain()
let mappingLog = log.child('mapping')

if (this.archive == null && this.rpcEndpoint == null) {
throw new Error(
'No data source where specified. ' +
'Use .setArchive() to specify Subsquid Archive and/or .setRpcEndpoint() to specify RPC endpoint.'
)
}

if (this.archive == null && this.rpcIngestSettings?.disabled) {
throw new Error('Subsquid Archive is required when RPC data ingestion is disabled')
}

return new Runner({
database,
requests: this.getBatchRequests(),
archive: this.archive ? this.getArchiveDataSource() : undefined,
hotDataSource: this.rpcEndpoint && !this.rpcIngestSettings?.disabled
? this.getHotDataSource()
: undefined,
allBlocksAreFinal: this.finalityConfirmation === 0,
prometheus: this.getPrometheusServer(),
log,
process(store, batch) {
return handler({
_chain: chain,
log: mappingLog,
store,
blocks: batch.blocks as any,
isHead: batch.isHead
})
}
}).run()
}, err => log.fatal(err))
}
}
Expand Down
4 changes: 4 additions & 0 deletions util/portal-client/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,10 @@ class PortalStreamBuffer<B extends Block> {
}

async put(blocks: B[], bytes: number) {
if (this.state !== 'open') {
throw new Error('buffer is closed')
}

this.lastChunkTimestamp = Date.now()
if (this.idleInterval == null) {
this.idleInterval = setInterval(() => {
Expand Down

0 comments on commit d212036

Please sign in to comment.