<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: levithefirst</title>
    <description>The latest articles on DEV Community by levithefirst (@levithefirst).</description>
    <link>https://dev.to/levithefirst</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4232395%2Fff1c53e0-21f2-4d42-aef4-d80699a3e1a5.jpg</url>
      <title>DEV Community: levithefirst</title>
      <link>https://dev.to/levithefirst</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/levithefirst"/>
    <language>en</language>
    <item>
      <title>Clew : Remembering the retry that worked</title>
      <dc:creator>levithefirst</dc:creator>
      <pubDate>Sat, 07 Nov 2026 16:05:41 +0000</pubDate>
      <link>https://dev.to/levithefirst/clew-remembering-the-retry-that-worked-9gj</link>
      <guid>https://dev.to/levithefirst/clew-remembering-the-retry-that-worked-9gj</guid>
      <description>&lt;h1&gt;
  
  
  Clew: remembering the retry that worked
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;Tatum × Walrus Memory “Total Recall” hackathon. Live at &lt;a href="https://useclew.vercel.app" rel="noopener noreferrer"&gt;useclew.vercel.app&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A transaction reverts. The wallet says “execution reverted”, maybe with a reason string. Someone tweaks a number, resubmits, and it goes through. A week later the same wallet hits the same contract with the same error and starts from zero, because nothing kept the fix.&lt;/p&gt;

&lt;p&gt;If you build agents that send transactions, that loop burns retries and leaves you guessing which change actually landed. Wallet users hit the same wall: they pay gas twice and still walk away without knowing whether a slippage limit or a deadline was the thing that moved. Hackathon judges can check a concrete claim on real Mainnet data: a stored memory changes what you do on the next failure.&lt;/p&gt;

&lt;p&gt;Clew watches that loop and stores it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Clew does
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;A transaction fails. Clew reads the receipt and decodes why.&lt;/li&gt;
&lt;li&gt;The same wallet retries the same contract and succeeds. Clew diffs the two attempts and writes what changed to Walrus Memory on Mainnet.&lt;/li&gt;
&lt;li&gt;The next time that wallet fails on that contract with a similar error, Clew recalls the memory and returns the prior successful transaction plus a concrete next action.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;With an empty memory it can only say the transaction reverted. Once a memory exists, it can name which words in the call changed, and point at the retry that landed.&lt;/p&gt;

&lt;p&gt;The public website never writes. Both the Try it box and the agent endpoint only read.&lt;/p&gt;

&lt;p&gt;If you run an agent that retries failed swaps, send the failed hash to &lt;code&gt;/v1/recall&lt;/code&gt; and you get the last path that worked for that wallet and contract.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Tatum is used
&lt;/h2&gt;

&lt;p&gt;Every chain read goes through Tatum, so a pasted failure is decoded from a live receipt.&lt;/p&gt;

&lt;p&gt;On Base, Ethereum and Polygon that means the JSON-RPC gateways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;eth_getTransactionReceipt&lt;/code&gt; for status. Clew treats &lt;code&gt;0x0&lt;/code&gt; as a failure and only accepts a later &lt;code&gt;0x1&lt;/code&gt; transaction as the retry.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;eth_getTransactionByHash&lt;/code&gt; for calldata, gas limit, gas price, value and nonce. &lt;code&gt;eth_getBlockByNumber&lt;/code&gt; for the timestamp.&lt;/li&gt;
&lt;li&gt;Revert decoding via &lt;code&gt;debug_traceTransaction&lt;/code&gt; with &lt;code&gt;callTracer&lt;/code&gt;, falling back to an &lt;code&gt;eth_call&lt;/code&gt; replay at &lt;code&gt;block - 1&lt;/code&gt;. Clew decodes &lt;code&gt;Error(string)&lt;/code&gt; (&lt;code&gt;0x08c379a0&lt;/code&gt;), &lt;code&gt;Panic(uint256)&lt;/code&gt; (&lt;code&gt;0x4e487b71&lt;/code&gt;) and custom error selectors, then normalizes them into a signature such as &lt;code&gt;revert:too_little_received&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;eth_getBlockReceipts&lt;/code&gt; to find the successful retry from the same wallet to the same contract after the failure.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The free plan allows 3 requests a second. Clew spaces its calls about 360 ms apart and backs off on HTTP 429.&lt;/p&gt;

&lt;p&gt;Sui uses a different door on the same provider. Tatum’s Sui gateway serves GraphQL only (&lt;code&gt;POST https://sui-mainnet.gateway.tatum.io/graphql&lt;/code&gt;). A first attempt at &lt;code&gt;sui_*&lt;/code&gt; JSON-RPC came back HTTP 404, so the adapter was rewritten against GraphQL. One transaction query returns the sender, gas budget and price, status, checkpoint, Move calls, Pure inputs, and &lt;code&gt;executionError&lt;/code&gt; (the module, function and abort code where it died). That becomes a signature like &lt;code&gt;moveabort:errors::err_amount_out_slippage_check_failed:1&lt;/code&gt;. Finding the retry is supposed to take one filtered query: same sender, same &lt;code&gt;package::module&lt;/code&gt;, after the failure’s checkpoint.&lt;/p&gt;

&lt;p&gt;That GraphQL path was verified on Sui Mainnet on 31 October 2026: the gateway answered at checkpoint 340173364, recent programmable transactions decoded, and two real fail → success pairs were written to Walrus. On 7 November 2026, single-transaction reads still worked and the live &lt;code&gt;/v1/recall&lt;/code&gt; endpoint answered two digests with the same structured shape as Base. The list query (&lt;code&gt;transactions&lt;/code&gt;) returned “Failed to list transactions” that day, so a &lt;em&gt;new&lt;/em&gt; pair could not be discovered then.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Walrus Memory is used
&lt;/h2&gt;

&lt;p&gt;Memories go to the Walrus Memory Mainnet relayer (&lt;code&gt;https://relayer.memory.walrus.xyz&lt;/code&gt;) in namespace &lt;code&gt;clew&lt;/code&gt;, through &lt;code&gt;@mysten-incubation/memwal&lt;/code&gt;. Later failures from the same wallet can pick up the retry that already worked because that write lives there.&lt;/p&gt;

&lt;p&gt;A write is &lt;code&gt;remember(text, { idempotencyKey: "chain:failedTx:successTx" })&lt;/code&gt;, then &lt;code&gt;waitForRememberJob&lt;/code&gt; until a &lt;code&gt;blob_id&lt;/code&gt; comes back. If that confirmation never arrives, the pair is not treated as stored. A read is &lt;code&gt;recall&lt;/code&gt; with a query built from the new failure’s chain, contract, wallet, error and selector. Recall is semantic, so Clew then applies a strict filter: exact chain, exact contract, exact wallet, and a similar error. Another wallet’s path is never reused.&lt;/p&gt;

&lt;p&gt;The memory text is plain and factual, tags first so both recall and the filter have something to hold on to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CLEW chain=base contract=0x8ea5… wallet=0x336a… error=revert:too_little_received selector=0x708909ad
failed_tx=0x15f0… success_tx=0x389a… success_block=53152834. … Change: … NEXT_ACTION: …
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are 16 fail → success memories in namespace &lt;code&gt;clew&lt;/code&gt; (10 Base, 2 Ethereum, 2 Polygon, 2 Sui), plus one corrected rewrite of the first Base pair (&lt;code&gt;rev=2&lt;/code&gt;, blob &lt;code&gt;-TPBis5hFtwGoakXTDFdqTR9coE_OTCNTX70TUTB3sA&lt;/code&gt;). Walrus blobs are never edited in place; a correction is a new write with its own idempotency key, linked from &lt;code&gt;memories.json&lt;/code&gt; by &lt;code&gt;supersedes&lt;/code&gt;. Job and blob ids are in that file. Each blob resolves on Walruscan Mainnet. The content is SEAL-encrypted, so the explorer proves the write happened without exposing the text.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the memory changes the next action
&lt;/h2&gt;

&lt;p&gt;On 7 November 2026 the measurement harness (&lt;code&gt;npm run measure&lt;/code&gt;) loaded eight real Mainnet failures through Tatum and recalled each one twice: once from an empty namespace, once from &lt;code&gt;clew&lt;/code&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;chain&lt;/th&gt;
&lt;th&gt;failed tx&lt;/th&gt;
&lt;th&gt;memory off&lt;/th&gt;
&lt;th&gt;memory on&lt;/th&gt;
&lt;th&gt;confidence&lt;/th&gt;
&lt;th&gt;successes&lt;/th&gt;
&lt;th&gt;later failures&lt;/th&gt;
&lt;th&gt;demotion&lt;/th&gt;
&lt;th&gt;prior retries&lt;/th&gt;
&lt;th&gt;most consistent change&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;base&lt;/td&gt;
&lt;td&gt;&lt;code&gt;0xd72b632220fb7e79d8fb671a0109b791a12c6ccc3f9604b52507f6a994864bb6&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;abstain&lt;/td&gt;
&lt;td&gt;retry&lt;/td&gt;
&lt;td&gt;0.5&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;true&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;calldata word 4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;base&lt;/td&gt;
&lt;td&gt;&lt;code&gt;0x15f0e33c6bcaae91577346de3efac3680848b1158407ee77dbc6d743361ac153&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;abstain&lt;/td&gt;
&lt;td&gt;retry&lt;/td&gt;
&lt;td&gt;0.5&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;true&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;calldata word 4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;base&lt;/td&gt;
&lt;td&gt;&lt;code&gt;0x05b27e704245baa2b30307e1b283e0a596b5db1f2454dfb0cc96d25806fc07a8&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;abstain&lt;/td&gt;
&lt;td&gt;retry&lt;/td&gt;
&lt;td&gt;0.5&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;false&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;calldata word 1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;base&lt;/td&gt;
&lt;td&gt;&lt;code&gt;0x54d4427fe0abdc40e6b3f1f5c430ae7352eb58b9f75119a6262dd627bacaeaf1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;abstain&lt;/td&gt;
&lt;td&gt;retry&lt;/td&gt;
&lt;td&gt;0.5&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;true&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;calldata word 4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;base&lt;/td&gt;
&lt;td&gt;&lt;code&gt;0x987c3e003ef5d797cecf170f2e5a2342658ac27608728a404f9ce8c6d127abce&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;abstain&lt;/td&gt;
&lt;td&gt;retry&lt;/td&gt;
&lt;td&gt;0.5&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;false&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;calldata word 0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ethereum&lt;/td&gt;
&lt;td&gt;&lt;code&gt;0xd55c0f54b9b10b56cf83ec4c919224adca39c5ffd825486129f95c4f850b8a20&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;abstain&lt;/td&gt;
&lt;td&gt;retry&lt;/td&gt;
&lt;td&gt;0.5&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;false&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;calldata word 2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;polygon&lt;/td&gt;
&lt;td&gt;&lt;code&gt;0x08272ab634d6c29f7e7bc88dc56e90d8a890f9bd0f6f9d6d565f37d359492f81&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;abstain&lt;/td&gt;
&lt;td&gt;retry&lt;/td&gt;
&lt;td&gt;0.5&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;false&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;calldata word 0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;sui&lt;/td&gt;
&lt;td&gt;&lt;code&gt;GXwW6feRx386m9W3z7UX9CRWAFNyuGETWPux6zZR48Vj&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;abstain&lt;/td&gt;
&lt;td&gt;retry&lt;/td&gt;
&lt;td&gt;0.5&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;false&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;a higher gas price on the retry&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Memory off abstained on all eight. With the &lt;code&gt;clew&lt;/code&gt; namespace loaded, every row came back as &lt;code&gt;retry&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;An agent that calls this without memory gets an abstain. Against namespace &lt;code&gt;clew&lt;/code&gt;, that same call gets a retry and the change that already worked.&lt;/p&gt;

&lt;p&gt;The three Base rows with two successes are the same wallet (&lt;code&gt;0x336a079d7b894f6b6356674b3ad668bffdd5811d&lt;/code&gt;) on the same contract (&lt;code&gt;0x8ea5ad2a58c1dae75394b1e8636e6518eb6dac50&lt;/code&gt;) after the same error (“Too little received”). Clew counts which changes repeated across those earlier retries and leads with the most common, labelled with the count.&lt;/p&gt;

&lt;p&gt;For &lt;code&gt;0xd72b…4bb6&lt;/code&gt;, memory off says:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Tx 0xd72b632220fb7e79d8fb671a0109b791a12c6ccc3f9604b52507f6a994864bb6 on base reverted (revert:too_little_received). No prior successful path on record for this wallet+contract. Check params and retry.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Memory on ranks the two stored retries and returns a next action of this shape:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Prior successful retry (template): 0x29751e28caca024f75206b8512122148d203afe710f6fa351af4f73e89a8d757
- Most consistent change: calldata word 4, in 2 of 2 earlier retries that succeeded after this same error.
- Also seen: calldata word 15, in 2 of 2.
- Also seen: calldata word 16, in 2 of 2.
- Also differed, not shown as a cause: a higher gas price on the retry (1 of 2).
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The live &lt;code&gt;/v1/recall&lt;/code&gt; object for that same hash reported &lt;code&gt;action: "retry"&lt;/code&gt;, &lt;code&gt;confidence: 0.5&lt;/code&gt;, &lt;code&gt;priorRetries: 2&lt;/code&gt;, &lt;code&gt;evidence.successes: 2&lt;/code&gt;, &lt;code&gt;evidence.laterFailures: 1&lt;/code&gt;, &lt;code&gt;evidence.mostConsistentChange: "calldata word 4"&lt;/code&gt;, and &lt;code&gt;demotionFlag: true&lt;/code&gt;. Confidence is &lt;code&gt;successes / (successes + laterFailures + 1)&lt;/code&gt;, so two successes and one later failure land at 0.5. That later failure sets the demotion flag. Retry stays the action because successes still outnumber later failures.&lt;/p&gt;

&lt;p&gt;Clew does not invent a reason those words moved. It reports that they moved in both retries that worked, and it hands back the newest of those retries as a template. A gas hint only appears when the failed attempt actually ran out of gas. None of the stored failures did.&lt;/p&gt;

&lt;h2&gt;
  
  
  The agent endpoint
&lt;/h2&gt;

&lt;p&gt;Agents can call a read-only HTTP endpoint instead of scraping the website.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;POST https://useclew.vercel.app/v1/recall
{ "chain": "base", "failedTxHash": "0xd72b…", "agentId": "optional" }
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;GET /v1/recall?chain=base&amp;amp;failedTxHash=0xd72b…&lt;/code&gt; is the same read-only call as a shareable link.&lt;/p&gt;

&lt;p&gt;The response is one object: &lt;code&gt;action&lt;/code&gt; (&lt;code&gt;retry&lt;/code&gt;, &lt;code&gt;abort&lt;/code&gt;, or &lt;code&gt;abstain&lt;/code&gt;), &lt;code&gt;recommended&lt;/code&gt; (calldata with the remembered change applied, gas limit, gas price, &lt;code&gt;nonceStrategy: "next"&lt;/code&gt;), &lt;code&gt;confidence&lt;/code&gt;, &lt;code&gt;evidence&lt;/code&gt; (successes, later failures, the most consistent change, Walrus blob ids), &lt;code&gt;demotionFlag&lt;/code&gt;, and &lt;code&gt;priorRetries&lt;/code&gt;. On Sui, &lt;code&gt;recommended.calldata&lt;/code&gt; is null because Sui uses Pure inputs.&lt;/p&gt;

&lt;p&gt;Nothing in this path writes to Walrus. Errors come back as &lt;code&gt;{ "error": { "code", "message" } }&lt;/code&gt;. The endpoint allows 12 calls a minute and caches an answer for 60 seconds. Live Sui reads require &lt;code&gt;CLEW_SUI_LIVE=1&lt;/code&gt; on the deployment; production has that set.&lt;/p&gt;

&lt;p&gt;The Try it page calls this endpoint for the same hash it just compared, and renders the fields under “Agent response”.&lt;/p&gt;

&lt;h2&gt;
  
  
  An honest note on the data
&lt;/h2&gt;

&lt;p&gt;Most wallets that fail and then succeed on the same contract within minutes are bots: routers, MEV searchers, relayers. Clew labels each stored pair with a small public heuristic (lifetime transaction count, how fast the retry landed, other transactions in between, how often the wallet hit the same contract). Any one of those signals makes a wallet bot-like. When none of them fire, Clew labels the wallet human-like. That label means the heuristic saw no automation. It does not confirm a person sent the transaction.&lt;/p&gt;

&lt;p&gt;Of the 17 ledger entries, 14 are bot-like, 2 are human-like, and 1 is unclassified. That unclassified wallet is a Sui sender; Sui has no account nonce, so only retry latency can be checked, and that is not enough. Ethereum &lt;code&gt;0xaffa7d95ea5984a18e1b4d6f38c1175bdb18a793&lt;/code&gt; (65 prior transactions, retried about 48 seconds later, one calldata word changed: a deadline moved 60 seconds forward) and Base &lt;code&gt;0xf22f566751f933545deb42c1637adeb7fa11ee24&lt;/code&gt; (982 prior transactions, retried about five minutes later, calldata word 1 changed) are the two human-like wallets. The Base one is the lower-activity example in this set. 982 transactions is still a lot of history, just nowhere near the bot-like wallets in this set (some of those run to tens of thousands or millions of prior transactions, and retry within seconds).&lt;/p&gt;

&lt;p&gt;So in the real data the remembered “fix” is often a fresh quote, a new deadline, or a higher gas price. Clew still stores it, because the next failure from that same wallet can reuse the path that actually landed.&lt;/p&gt;

&lt;p&gt;Paste a failed hash at &lt;a href="https://useclew.vercel.app" rel="noopener noreferrer"&gt;useclew.vercel.app&lt;/a&gt; if you want to see the memory-off and memory-on split yourself. The screen-by-screen video script is in &lt;code&gt;DEMO_SCRIPT.md&lt;/code&gt;.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>hackathon</category>
      <category>software</category>
      <category>web3</category>
    </item>
  </channel>
</rss>
