Skip to content

Commit

Permalink
Merge pull request #95 from ava-labs/fix/mempool-limit
Browse files Browse the repository at this point in the history
Limit requests
  • Loading branch information
rajranjan0608 authored May 3, 2023
2 parents 7720602 + ef016f4 commit cd1fb96
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"CHAINID": 43113,
"EXPLORER": "https://testnet.snowtrace.io",
"IMAGE": "https://glacier-api.avax.network/proxy/chain-assets/main/chains/43113/chain-logo.png",
"MAX_PRIORITY_FEE": "2000000000",
"MAX_PRIORITY_FEE": "2500000000",
"MAX_FEE": "100000000000",
"DRIP_AMOUNT": 2,
"DECIMALS": 18,
Expand Down
6 changes: 6 additions & 0 deletions vms/evm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ export default class EVM {
return
}

// do not accept any request if mempool limit reached
if (this.pendingTxNonces.size >= MEMPOOL_LIMIT) {
cb({ status: 400, message: "High faucet usage! Please try after sometime" })
return
}

let amount: BN = this.DRIP_AMOUNT

// If id is provided, then it is ERC20 token transfer, so update the amount
Expand Down

0 comments on commit cd1fb96

Please sign in to comment.