Skip to content

Commit

Permalink
longer delays
Browse files Browse the repository at this point in the history
  • Loading branch information
killroy192 committed Jul 21, 2024
1 parent 9383124 commit 77d1680
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/core/scroll/canvas/canvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const getAccountToMint = async (wallets: EVMWallet[], processedWallets: Processe
const makeConfig = prepare(expenses);
for (const wallet of wallets) {
if (!processedWallets[wallet.address]) {
await sleep(1500);
await sleep(getRandomArbitrary(2500, 5000));
const config = await makeConfig(wallet);
if (config.isEligible) {
return config;
Expand Down
9 changes: 6 additions & 3 deletions src/core/scroll/kelp/deposit.kelp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ const deposit = async (wallet: EVMWallet, toDeposit: bigint) => {
const receipt = await walletClient.waitForTransactionReceipt({
hash: txHash,
});
logger.info(`tx hash: ${receipt.transactionHash}`, { label: "deposit.kelp" });
logger.info(`tx hash: ${receipt.transactionHash}`, { label: "scroll.deposit.kelp" });
return receipt;
} catch (error) {
logger.error((error as Error).message, { label: "canvas" });
logger.error((error as Error).message, { label: "scroll.deposit.kelp" });
}
};

Expand All @@ -48,6 +48,7 @@ type PrepareFnParams = {

const prepare = (params: PrepareFnParams) => async (wallet: EVMWallet) => {
const publicClient = await getPublicClient(chain);
logger.debug(`prepare: ${wallet.address}`, { label: "scroll.deposit.kelp" });
const userBalanceInKelp = (await publicClient.readContract({
address: KELP_POOL_SCROLL_ADDRESS,
abi: KELP_POOL_SCROLL_ABI,
Expand All @@ -67,6 +68,8 @@ const prepare = (params: PrepareFnParams) => async (wallet: EVMWallet) => {
toDeposit > 0n &&
params.ethPrice * toDeposit >= params.minDeposit;

logger.debug(`isEligible: ${isEligible}`, { label: "scroll.deposit.kelp" });

return {
wallet,
isEligible,
Expand Down Expand Up @@ -100,7 +103,7 @@ const getAccountToDeposit = async (wallets: EVMWallet[], processedWallets: Proce
const makeConfig = prepare({ expenses, ethPrice, minDeposit: parseEther(String(minDeposit)) });
for (const wallet of wallets) {
if (!processedWallets[wallet.address]) {
await sleep(1500);
await sleep(getRandomArbitrary(2500, 5000));
const config = await makeConfig(wallet);
if (config.isEligible) {
return config;
Expand Down
5 changes: 1 addition & 4 deletions src/libs/clients.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ const getRpcUrl = async (chain: chains.Chain) => {
case chains.scroll.id:
// return chains.scroll.rpcUrls.default.http[0];
return "https://scroll.drpc.org";
// return "https://scroll-mainnet.rpc.grove.city/v1/a7a7c8e2";
// return "https://1rpc.io/scroll";
// return "https://534352.rpc.thirdweb.com";
// return `https://blue-greatest-knowledge.scroll-mainnet.quiknode.pro/${conf.rpc.qnode.keyᵻ}`;
default:
return `https://${chainIdToAlchemyNetworksMap[chain.id]}.g.alchemy.com/v2/${conf.rpc.alchemy.keyᵻ}`;
Expand All @@ -38,7 +35,7 @@ async function transport(chain: chains.Chain, proxy?: AxiosInstance) {
return custom({
async request(body: { method: string; params: any[] }) {
if (chain.id === chains.scroll.id) {
await sleep(500);
await sleep(1500);
}

logger.debug(`request ${JSON.stringify(body)}`, { label: "Custom_RPC_req" });
Expand Down

0 comments on commit 77d1680

Please sign in to comment.