tablelandnetwork / studio

Discover, design, deploy, and manage data driven web3 apps on Tableland.
https://studio.tableland.xyz
4 stars 1 forks source link

(nonce) ensure incrby does not remove ttl #303

Closed joewagner closed 2 months ago

joewagner commented 2 months ago

Overview

A user reported an issue creating an account this week. This resulted from the nonce delta key not having an expire.

Details

After some debugging and reading, I believe that the redis incrby command is clearing the expire value and the key is never being removed if the chain provider requests timeout or are throttled.

Here is the relevant error log when the provider request fails:

Error resetting delta: Error: could not coalesce error (error={ "code": -32007, "message": "15/second request limit reached - reduce calls per second or upgrade your account at quicknode.com" }, payload={ "id": 79, "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": [ "0x133cd82245df7ea68820efff1e0c34e3d5d8a1165f2cf927c51ae96736de571e" ] }, code=UNKNOWN_ERROR, version=6.12.1)
    at a (/var/task/packages/web/.next/server/chunks/947.js:319:281264)
    at D.getRpcError (/var/task/packages/web/.next/server/chunks/947.js:319:246129)
    at /var/task/packages/web/.next/server/chunks/947.js:319:239056
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 'UNKNOWN_ERROR',
  error: {
    code: -32007,
    message: '15/second request limit reached - reduce calls per second or upgrade your account at quicknode.com'
  },
  payload: {
    method: 'eth_getTransactionReceipt',
    params: [
      '0x133cd82245df7ea68820efff1e0c34e3d5d8a1165f2cf927c51ae96736de571e'
    ],
    id: 79,
    jsonrpc: '2.0'
  },
  shortMessage: 'could not coalesce error'
}

Fix

This fix simply re-adds the expire value to the key when increment is called

vercel[bot] commented 2 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 24, 2024 3:59pm