Skip to content

Commit

Permalink
fix(BundleDataClient): When historical deposit is found, save into v3…
Browse files Browse the repository at this point in the history
…RelayHash (#1234)

* fix(BundleDataClient): When historical deposit is found, save into v3RelayHash

We should save matched deposits into the dictionary, otherwise we violate an assumption that fiulls/slow fill requests that matched deposits have those deposits stored in memory

* Update InventoryClient.ts
  • Loading branch information
nicholaspai authored Feb 24, 2024
1 parent 0989ad8 commit 8c5dd9f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/clients/BundleDataClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ export class BundleDataClient {
...fill,
quoteTimestamp: matchedDeposit.quoteTimestamp,
});

v3RelayHashes[relayDataHash].deposit = matchedDeposit;
if (fill.relayExecutionInfo.fillType === FillType.ReplacedSlowFill) {
fastFillsReplacingSlowFills.push(relayDataHash);
}
Expand Down Expand Up @@ -821,6 +821,7 @@ export class BundleDataClient {
// sanity check it here by comparing the full relay hashes. If there's an error here then the
// historical deposit query is not working as expected.
assert(utils.getV3RelayHashFromEvent(matchedDeposit) === relayDataHash);
v3RelayHashes[relayDataHash].deposit = matchedDeposit;

// Note: we don't need to query for a historical fill at this point because a fill
// cannot precede a slow fill request and if the fill came after the slow fill request,
Expand Down

0 comments on commit 8c5dd9f

Please sign in to comment.