Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
feat: postpone orders missing in the give-chain rather then reject th…
Browse files Browse the repository at this point in the history
…em (#165)
  • Loading branch information
alexeychr authored Dec 21, 2023
1 parent 7da14d3 commit 96535e6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@debridge-finance/dln-taker",
"version": "3.2.0",
"version": "3.2.1",
"description": "DLN executor is the rule-based daemon service developed to automatically execute orders placed on the deSwap Liquidity Network (DLN) across supported blockchains",
"license": "GPL-3.0-only",
"author": "deBridge",
Expand Down
2 changes: 1 addition & 1 deletion src/chain-common/order-validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ export class OrderValidator extends OrderEvaluationContextual {

if (giveOrderStatus?.status === undefined) {
const message = `order does not exist on the give chain (${ChainId[giveChainId]})`;
return this.sc.reject(RejectionReason.MISSING, message);
return this.sc.postpone(PostponingReason.MISSING, message);
}

if (giveOrderStatus?.status !== OrderState.Created) {
Expand Down
12 changes: 6 additions & 6 deletions src/hooks/HookEnums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ export enum PostponingReason {
* triggered when throughput has reached its limit for the given give chain
*/
CAPPED_THROUGHPUT,

/**
* indicates that the order is missing on the give chain. One of the possible reasons is a lag in the RPC node, which
* is often the case when it comes to Solana
*/
MISSING,
}

export enum RejectionReason {
Expand All @@ -67,12 +73,6 @@ export enum RejectionReason {
*/
UNEXPECTED_GIVE_STATUS,

/**
* indicates that the order is missing on the give chain.
* This is extremely unlikely, and indicates protocol discrepancy if happens
*/
MISSING,

/**
* indicates that the order is revoked due to chain reorg
*/
Expand Down

0 comments on commit 96535e6

Please sign in to comment.