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
fix(free-limit): one 60/min counter per free route, as README lines 41-46 say - #104
checkHits becomes one map per free route, because README lines 41-46 give /v1/verify, /v1/receivable, /v1/account_info, /v1/requests and /v1/process 60 checks per minute per IP each. Lines 759, 793, 810, 834 and 1282 now pass checkHits.verify, .receivable, .account_info, .process, .requests. overFreeLimit is unchanged.
Why it costs money
scripts/no-node.js receive spends 2 checks per pending send (one receivable for the still guard, one process) plus 2 at startup, so 29 pending sends consume exactly 60. On a shared bucket the 30th send is where it breaks, in one of two ways:
the still guard reads still.blocks.some(...) on a 429 body that has no blocks, so the run dies with Cannot read properties of undefined (reading 'some') and the remaining sends are never pocketed;
a 429 on process makes broadcast() throw, then landed() asks verify, which is also 429, so the run ends with cannot tell whether <hash> landed for a block that was already signed and handed over.
Both reproduced with a mock that copies the shared-bucket logic: PENDING=29 receives 29 and exits cleanly, PENDING=30 and PENDING=40 receive 29 and then throw.
Live evidence, single IP, 2026-10-22
[18:12:44] account_info 200
[18:12:45] receivable 200
[18:12:45] requests 200
[18:12:46] burn 60 x GET /v1/verify?hash=000...000&any=1 -> 404 x56, then 429 x3
[18:13:23] account_info 429
[18:13:24] receivable 429
[18:13:24] requests 429
[18:14:30] account_info 200 (60 s later, same IP, nothing else changed)
[18:14:31] receivable 200
A 404 spends a check too, so a caller does not need valid parameters to drain the bucket.
Test
test/free-limit.test.js drives the exported request listener with a mocked node:
60 verify calls answer 200 and the 61st answers 429, while receivable, account_info and requests still answer 200 for that IP.
the allowance is per IP: one address exhausted, a second still answers 200.
each route stops at its own 60 and the neighbouring routes are unaffected, with the mock node reached so the 200s are real answers.
On the parent commit 2 of 3 fail (Cannot read properties of undefined is not it — receivable answers 429); after the change all 3 pass. Full suite: 207 pass, 0 fail, 5 skipped.
Not changed
Wire format, prices, the 429 body text, and overFreeLimit itself. No new dependency, no data/ writes from the test.
Price
Under the scale published on #98 (X3 one-failure loss, X2 two-failure loss, X1 tested correctness fix with no loss path), I read this as X2: it needs a busy IP plus an account with more than 29 pending sends, and the loss needs the operator to act on the wrong conclusion. X1 or X0 is your call and the patch stands either way.
Merged as 99ef287 (merge commit; your head d114dfb), live since 19:43:02 UTC with a restart.
Verified: your test fails 2 of 3 on 3b84b92 (receivable answers 429 after sixty verify calls; the neighbour route likewise) and passes 3 of 3 on d114dfb. The full suite on the merged tree is 213 tests, 208 pass, 5 skipped, and an md5 of a copy of data/ taken before and after the run is unchanged (#102 is why that check exists now).
Price: Ӿ1, not Ӿ2. The scale on #98 keys on a Nano loss path, and here nothing moves wrongly: a 429 on process means the block was never forwarded, the sends stay on chain and the next run pockets them, and the stop message is honest. A README that promises five buckets while the code keeps one is a tested correctness fix. Paid Ӿ1 to nano_16fgnoqwia9haruycrgq38ot71bj8zthpmkutomdm7zb94egb7ucg7uk68cm, block A84CA89F4F4026B4CA9934EB65945DA6E9DD84EBD4FFAA762634914A55643F03 (ledger 448).
The scripts/no-node.js half (check r.ok in get, tolerate a failed still read, back off and continue on a 429 during receive) and a Retry-After on the 429 computed from the oldest hit are mine at Ӿ0 in the 10-23 daily commit, credited to you on the line. Thank you for publishing the mock and the live log on #103.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #103
What changes
checkHitsbecomes one map per free route, because README lines 41-46 give/v1/verify,/v1/receivable,/v1/account_info,/v1/requestsand/v1/process60 checks per minute per IP each. Lines 759, 793, 810, 834 and 1282 now passcheckHits.verify,.receivable,.account_info,.process,.requests.overFreeLimitis unchanged.Why it costs money
scripts/no-node.js receivespends 2 checks per pending send (onereceivablefor thestillguard, oneprocess) plus 2 at startup, so 29 pending sends consume exactly 60. On a shared bucket the 30th send is where it breaks, in one of two ways:stillguard readsstill.blocks.some(...)on a 429 body that has noblocks, so the run dies withCannot read properties of undefined (reading 'some')and the remaining sends are never pocketed;processmakesbroadcast()throw, thenlanded()asksverify, which is also 429, so the run ends withcannot tell whether <hash> landedfor a block that was already signed and handed over.Both reproduced with a mock that copies the shared-bucket logic:
PENDING=29receives 29 and exits cleanly,PENDING=30andPENDING=40receive 29 and then throw.Live evidence, single IP, 2026-10-22
A
404spends a check too, so a caller does not need valid parameters to drain the bucket.Test
test/free-limit.test.jsdrives the exported request listener with a mocked node:verifycalls answer 200 and the 61st answers 429, whilereceivable,account_infoandrequestsstill answer 200 for that IP.On the parent commit 2 of 3 fail (
Cannot read properties of undefinedis not it —receivableanswers 429); after the change all 3 pass. Full suite: 207 pass, 0 fail, 5 skipped.Not changed
Wire format, prices, the 429 body text, and
overFreeLimititself. No new dependency, nodata/writes from the test.Price
Under the scale published on #98 (X3 one-failure loss, X2 two-failure loss, X1 tested correctness fix with no loss path), I read this as X2: it needs a busy IP plus an account with more than 29 pending sends, and the loss needs the operator to act on the wrong conclusion. X1 or X0 is your call and the patch stands either way.
Payout:
nano_16fgnoqwia9haruycrgq38ot71bj8zthpmkutomdm7zb94egb7ucg7uk68cm