Skip to content

feat(powfaucet): make concurrency-limit and recurring-limits matching configurable - #485

Merged
qu0b merged 2 commits into
masterfrom
qu0b/powfaucet-concurrency-config
Jul 30, 2026
Merged

qu0b merged 2 commits into
masterfrom
qu0b/powfaucet-concurrency-config

Conversation

@qu0b

@qu0b qu0b commented Jul 2, 2026 •

Copy link
Copy Markdown
Member

What

Expose the powfaucet concurrency-limit module's settings and a recurring-limits matching toggle as chart values, and stop hardcoding the transaction gas limit:

value default meaning
faucetConcurrencyLimitEnabled true enable/disable the concurrency-limit module
faucetConcurrencyLimit 1 max simultaneous running sessions per IP / target addr
faucetConcurrencyByAddrOnly false only check concurrency by target address
faucetConcurrencyByIPOnly false only check concurrency by IP address
faucetRecurringLimitsByAddrOnly false only match previous sessions by target address
faucetTxGasLimit (undeclared) ethTxGasLimit is only rendered when this is set — the faucet's built-in default applies otherwise; define it only for networks with different gas rules (e.g. L2s)

Chart version bumped 1.0.0 → 1.1.0.

Why

byAddrOnly toggles — both modules match sessions by target address or IP. When a trusted proxy fronts the faucet, every request carries the proxy's IP, so:

  • concurrency-limit (hardcoded concurrencyLimit: 1 by IP + addr) collapses to a single running session globally — one user mid-claim blocks everyone else's startSession.
  • recurring-limits (getFinishedSessions matches TargetAddr = ? OR RemoteIP LIKE ?) turns the per-user recurring amount into a global daily budget — once collectively exhausted, every user is blocked for the rest of the window.

The byAddrOnly toggles keep the still-meaningful per-address protections while dropping the proxy-IP collapse.

Gas limit — the chart hardcoded ethTxGasLimit: 21000, which every consumer has to override the moment gas rules change (a plain transfer creating the recipient account costs ~207k under Amsterdam rules — measured 207,391 via eth_estimateGas). The app is the right owner of the sane default; the chart now omits the setting unless explicitly overridden. Note: the value must be omitted rather than rendered as 0 — PoWFaucet uses gasLimit || config.ethTxGasLimit, so a literal 0 would send 0-gas transactions.

Compatibility

  • Concurrency/recurring defaults preserve the exact previous rendering — verified with helm template.
  • faucetTxGasLimit behavior change: deployments relying on the chart's old 21000 default now get the app default instead (more gas headroom, same recipient set — the faucet still only sends drops). Anyone who set the value explicitly is unaffected.

@qu0b
qu0b requested a review from skylenet as a code owner July 2, 2026 16:38
@qu0b
qu0b force-pushed the qu0b/powfaucet-concurrency-config branch 3 times, most recently from ee390fc to c9fe494 Compare July 30, 2026 09:33
@qu0b qu0b changed the title feat(powfaucet): make concurrency-limit configurable feat(powfaucet): make concurrency-limit and recurring-limits matching configurable Jul 30, 2026
@qu0b
qu0b requested review from barnabasbusa and pk910 July 30, 2026 09:39
@barnabasbusa

Copy link
Copy Markdown
Collaborator

faucetTxGasLimit: 21000

Imo this value should not be set anymore. Only define if you wanna use non default values.

@qu0b
qu0b force-pushed the qu0b/powfaucet-concurrency-config branch 2 times, most recently from 3ad2564 to e974249 Compare July 30, 2026 09:58
…ault gas limit

- Expose the concurrency-limit module (enabled/limit/byAddrOnly/byIPOnly) and a
  recurring-limits byAddrOnly toggle as values. Both matter when a trusted
  proxy fronts the faucet: all traffic shares the proxy IP, so per-IP
  concurrency collapses to one global session and the per-IP recurring limit
  becomes a global budget. byAddrOnly scopes both checks to the target address.
- faucetTxGasLimit now defaults to 0 = omit the setting, so the faucet's
  built-in default applies instead of a chart-side hardcode; explicit values
  remain for networks with different gas rules (e.g. L2s).
@qu0b
qu0b force-pushed the qu0b/powfaucet-concurrency-config branch from e974249 to 41754d7 Compare July 30, 2026 10:09
Comment thread charts/powfaucet/values.yaml Outdated
@@ -466,7 +481,9 @@ config: |

# transaction gas limit
# use 21000 to prevent transactions to contracts

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix comments too pls

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 875a6ab — value is undeclared now (define only to override) and the template comment no longer references the old 21000.

The value is now undeclared — define it only to override the faucet's
built-in default. The config comment no longer suggests the old 21000.
@qu0b

qu0b commented Jul 30, 2026

Copy link
Copy Markdown
Member Author

Dropped the faucetTxGasLimit declaration in 875a6ab — undeclared by default, define only for non-default gas rules. Stale template comment fixed too.

@qu0b
qu0b merged commit a1cf24f into master Jul 30, 2026
14 checks passed
@qu0b
qu0b deleted the qu0b/powfaucet-concurrency-config branch July 30, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants