diff --git a/design/admin-update-common-config.puml b/design/admin-update-common-config.puml deleted file mode 100644 index aab7881..0000000 --- a/design/admin-update-common-config.puml +++ /dev/null @@ -1,42 +0,0 @@ -@startuml 1 -title Lock From Eth to Mina -actor User -boundary fe as "Frontend" -control be as "Backend" -participant Ethereum -control evm_crawler as "EVM crawler" -control job_provider as "Job provider" -database db as "Database" -queue queue1 as "Queue" -control mina_validator as "Mina signature validators" -control mina_sender as "Mina tx sender" -control mina_crawler as "Mina crawler" -participant Mina -autonumber - -group#LightGreen (1) User lock token from Evm - - User -> fe : select network to bridge - - activate fe - fe -> be : get list of token pairs - activate be - be --> fe : list of token pairs - deactivate be - - User -> fe: select destination wallet, amount - fe --> User: display amount, tip, fee - User -> fe: perform bridge action - fe -> Ethereum: call lock tx using user's wallet - activate Ethereum - Ethereum --> fe: tx status success - deactivate Ethereum - - fe --> User: show popup success - deactivate fe - - -end - -@enduml - diff --git a/design/admin-update-eth-bridge-config.puml b/design/admin-update-eth-bridge-config.puml index e69de29..0d7b95d 100644 --- a/design/admin-update-eth-bridge-config.puml +++ b/design/admin-update-eth-bridge-config.puml @@ -0,0 +1,35 @@ +@startuml 1 +title Admin update tip and daily quota +actor User +boundary fe as "Frontend" +control be as "Backend" +database Database +autonumber +group#LightGreen Admin changes tip, daily quota for Evm/Mina + + User -> fe : Logged in with Evm/Mina wallet + + note right + Both Evm and Mina admin accounts + can changes these settings. + end note + activate fe + fe --> User : show configuration screen + deactivate fe + User -> fe : enter new tip, daily quota value. + activate fe + fe -> be: call api PUT: /api/admin/update-common-config/:configId + activate be + + be -> Database: persist changes + activate Database + Database --> be: update successfully + deactivate Database + be --> fe: api response 201 + deactivate be + fe --> User: popup success + deactivate fe +end + +@enduml + diff --git a/design/admin-update-min-max.puml b/design/admin-update-min-max.puml new file mode 100644 index 0000000..b57506a --- /dev/null +++ b/design/admin-update-min-max.puml @@ -0,0 +1,35 @@ +@startuml 1 +title Admin config min max amount +actor User +boundary fe as "Frontend" +participant wallet as "Metamask/ Auro Wallet" +participant network as "Mina/Eth" +autonumber +group#LightGreen Admin change min max amount to bridge Evm/Mina + + User -> fe : Logged in with Evm/Mina wallet + note right + Evm admin account can change Evm brige + configuration only and so does Mina admin account. + end note + activate fe + fe --> User : show Evm configuration screen + deactivate fe + User -> fe : enter new Min, Max value to Evm/Mina bridge + activate fe + fe -> wallet: trigger wallet for user confirmation + activate wallet + wallet --> User: show estimate fee dialog + User -> wallet: confirm transaction + wallet -> network: submit transaction + activate network + network --> wallet: status success + deactivate network + wallet --> fe: send tx success status + fe --> User: shop pop up success + deactivate fe + deactivate wallet +end + +@enduml + diff --git a/src/modules/crawler/job-unlock.provider.ts b/src/modules/crawler/job-unlock.provider.ts index ab8d86a..e7b1279 100644 --- a/src/modules/crawler/job-unlock.provider.ts +++ b/src/modules/crawler/job-unlock.provider.ts @@ -20,6 +20,8 @@ import { IGenerateSignature, IJobUnlockPayload, IUnlockToken } from './interface @Injectable() export class JobUnlockProvider { + private readonly signatureJobBackOff = 5 * 1000; + private readonly sendTxJobBackOff = 60 * 1000; constructor( private readonly queueService: QueueService, private readonly configService: ConfigService, @@ -134,7 +136,7 @@ export class JobUnlockProvider { }, { attempts: 5, - backoff: 5000, + backoff: this.signatureJobBackOff, jobId: `validate-signature-${data.eventLogId}-${i}`, }, ); @@ -156,7 +158,7 @@ export class JobUnlockProvider { }, { attempts: 5, - backoff: 5000, + backoff: this.sendTxJobBackOff, jobId: `send-tx-${data.eventLogId}`, }, ); @@ -171,7 +173,6 @@ export class JobUnlockProvider { await this.eventLogRepository.sumAmountBridgeOfUserInDay(address), ]); assert(!!dailyQuota, 'daily quota undefined'); - console.log(totalamount, addDecimal(dailyQuota.dailyQuota, fromDecimal)); if (totalamount && BigNumber(totalamount.totalamount).isLessThan(addDecimal(dailyQuota.dailyQuota, fromDecimal))) { return false;