You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 150ecc8
Browse filesBrowse the repository at this point in the historyBrowse files
fix(stake): gasless follow-ups before the flag goes on (review of #1558) (#1568)
- A relay that fails re-reads authorizationState: used (or canceled) answers 202
authorization_used_elsewhere, an unreadable state answers 202 send_not_checked, and only an
unused one answers 502 "no USDC moved". A signed authorization can be submitted by anyone and
pays the escrow, so a revert can mean the USDC did move.
- Refuse with 503 wrong_network unless NETWORK resolves to Base Sepolia: verifyEip3009Local takes
the EIP-712 chainId from NETWORK while the escrow sends only on 84532.
- The route's catch-all answers a fixed message; the error text goes to the log.
- The global 4/min admission budget can be griefed by four funded wallets: stated as a ponytail
ceiling with the upgrade options (a decision, not decided here).
- escrow-refunder.ts header names all three kinds of send on the escrow's one queue.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
error: 'The gasless deposit failed inside the server, so whether anything was sent is not known. Check this authorization on BaseScan before signing a new one.'});
if(deps.mode==='off')returnrefuse(503,'gasless_deposit_off','Gasless deposits are not enabled on this server. Nothing was sent.');
131
138
if(!deps.realStaking)returnrefuse(503,'real_staking_off','Real staking is not enabled on this server, so a deposit could not be credited. Nothing was sent.');
132
139
if(!deps.escrow)returnrefuse(503,'escrow_not_configured','The stake escrow is not configured on this server. Nothing was sent.');
140
+
// verifyEip3009Local takes the EIP-712 chainId from NETWORK (getActiveNetwork); the escrow sends only on
141
+
// Base Sepolia (84532). With NETWORK naming another chain, signatures would be checked for that chain.
142
+
letsigningChainId: number|null=null;
143
+
try{
144
+
signingChainId=getActiveNetwork().chainId;
145
+
}catch{
146
+
/* unknown NETWORK: refused below */
147
+
}
148
+
if(signingChainId!==BASE_SEPOLIA_CHAIN_ID){
149
+
returnrefuse(503,'wrong_network','This server checks signatures for a chain other than Base Sepolia, so gasless deposits are refused. Nothing was sent.');
error: "The escrow's submission failed and the authorization's state could not be re-read, so it is not known whether USDC moved. Check this authorization on BaseScan before signing a new one."},
error: "The escrow's submission failed, and the chain shows this authorization as used or canceled. If it was used, its USDC reached the escrow from another submitter: find that transaction on BaseScan and claim it with POST /api/v1/stake/deposit. If you canceled it, nothing moved."},
265
+
};
266
+
}
229
267
returnrefuse(502,'not_sent','The escrow did not submit the deposit, so no USDC moved.');
230
268
}
231
269
// The USDC has moved. From here every answer carries the tx hash: a credit that throws is not
0 commit comments