Skip to content

Commit

Permalink
fix missing deltas on 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
igorls committed Sep 9, 2021
1 parent 0d5d438 commit 0947f43
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 6 additions & 4 deletions modules/parsers/2.1-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,8 @@ export default class HyperionParser extends BaseParser {
}

const res = ds_msg[1];
let block = null;
let traces = [];
let deltas = [];

let block = null;
if (res.block && res.block.length) {

if (typeof res.block === 'object' && res.block.length === 2) {
Expand Down Expand Up @@ -180,6 +178,8 @@ export default class HyperionParser extends BaseParser {
}
}

// unpack traces
let traces = null;
if (allowProcessing && res.traces && res.traces.length) {

// deserialize transaction_trace using abieos (faster)
Expand Down Expand Up @@ -208,12 +208,14 @@ export default class HyperionParser extends BaseParser {
}
}

// unpack deltas
let deltas = null;
if (allowProcessing && res.deltas && res.deltas.length) {

// deserialize table_delta using abieos
try {
ds_times.abieos.table_delta = timedFunction(dsProfiling, () => {
worker.deserializeNative('table_delta[]', res.deltas);
deltas = worker.deserializeNative('table_delta[]', res.deltas);
});
} catch (e) {
hLog('table_delta[] deserialization failed with abieos!');
Expand Down
2 changes: 2 additions & 0 deletions workers/deserializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,7 @@ export default class MainDSWorker extends HyperionWorker {
deltaStructHandlers = {

"contract_row": async (payload, block_num, block_ts, row, block_id) => {

if (this.conf.indexer.abi_scan_mode) {
return false;
}
Expand Down Expand Up @@ -1182,6 +1183,7 @@ export default class MainDSWorker extends HyperionWorker {
if (process.env['live_mode'] === 'true') {
this.pushToDeltaStreamingQueue(buff, jsonRow);
}

if (typeof row.present !== "undefined") {
if (row.present === 0 && !this.conf.indexer.disable_delta_rm) {
if (this.ch_ready) {
Expand Down

0 comments on commit 0947f43

Please sign in to comment.