Skip to content

Commit

Permalink
more logs on price cache fix
Browse files Browse the repository at this point in the history
  • Loading branch information
prevostc committed Oct 26, 2024
1 parent 5e45e09 commit c5f94f5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 26 deletions.
13 changes: 8 additions & 5 deletions src/protocol/beefy/loader/investment/investor-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,8 @@ export function addMissingInvestorCacheUsdInfos$(options: { ctx: ImportCtx }) {
const hasDefinitelyNoPrices = successRanges.some((range) => rangeInclude(range, shouldInclude));
if (!hasDefinitelyNoPrices) {
logger.warn({
msg: "Found a cache entry without a first price but import state isn't green",
data: { row, successRanges, contractCreation },
msg: "Found a cache entry without a first price but import state isn't green (1)",
data: { row, successRanges, contractCreation, shouldInclude },
});
}
return hasDefinitelyNoPrices;
Expand All @@ -306,8 +306,8 @@ export function addMissingInvestorCacheUsdInfos$(options: { ctx: ImportCtx }) {
const isDefinitelyBeforeFirstPrice = successRanges.some((range) => rangeInclude(range, shouldInclude));
if (!isDefinitelyBeforeFirstPrice) {
logger.warn({
msg: "Found a cache entry with a trx before first price but import state isn't green",
data: { row, successRanges, contractCreation },
msg: "Found a cache entry with a trx before first price but import state isn't green (2)",
data: { row, successRanges, firstPrice, contractCreation, shouldInclude },
});
}
return isDefinitelyBeforeFirstPrice;
Expand Down Expand Up @@ -346,7 +346,10 @@ export function addMissingInvestorCacheUsdInfos$(options: { ctx: ImportCtx }) {
const isDefinitelyInterpolated = successRanges.some((range) => rangeInclude(range, shouldInclude));

if (!isDefinitelyInterpolated) {
logger.warn({ msg: "Found a price to interpolate but import state isn't green", data: { row, successRanges } });
logger.warn({
msg: "Found a price to interpolate but import state isn't green (3)",
data: { row, successRanges, firstPrice, shouldInclude },
});
}
return isDefinitelyInterpolated;
}),
Expand Down
23 changes: 2 additions & 21 deletions src/script/test-merge-import-ranges.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,8 @@
import { rangeCovering, rangeExcludeMany, rangeMerge } from "../utils/range";

const ranges = [
{ from: 111148617, to: 127177251 },
{ from: 127177280, to: 127177282 },
{ from: 127177311, to: 127177317 },
{ from: 127177342, to: 127177345 },
{ from: 127177374, to: 127177377 },
{ from: 127177406, to: 127177408 },
{ from: 127177436, to: 127177441 },
{ from: 127177468, to: 127177471 },
{ from: 127177500, to: 127177504 },
{ from: 127177532, to: 127177534 },
{ from: 127177566, to: 127177566 },
{ from: 127177595, to: 127177597 },
{ from: 127177626, to: 127177629 },
{ from: 127177658, to: 127177661 },
{ from: 127177690, to: 127177692 },
{ from: 127177721, to: 127177723 },
{ from: 127177752, to: 127177755 },
{ from: 127177784, to: 127177786 },
{ from: 127177815, to: 127177818 },
{ from: 127177846, to: 127177849 },
{ from: 127177878, to: 127177881 },
{ from: 111148617, to: 127178086 },
{ from: 127178181, to: 127178190 },
];

const covering = rangeCovering(ranges);
Expand Down

0 comments on commit c5f94f5

Please sign in to comment.