Skip to content

feat: add wip-1004 subsidy enforcement via handler hooks#649

Open
kilianglas wants to merge 1 commit into
mainfrom
kilianglas/wip-1004
Open

feat: add wip-1004 subsidy enforcement via handler hooks#649
kilianglas wants to merge 1 commit into
mainfrom
kilianglas/wip-1004

Conversation

@kilianglas

Copy link
Copy Markdown
Contributor

Summary

Adds WIP-1004, an alternative realization of subsidy enforcement to WIP-1003. Scoped to WIP-1001 0x1D transactions and realized through three op-revm Handler hook overrides. On OP-Stack, the subsidy is a no-op for the ETH ledger — the caller is not pre-charged for the subsidized fraction and the corresponding fee-vault credits in reward_beneficiary are skipped. No treasury, no minting; the per-nullifier WIP-1002 budget caps the operator's forgone fee revenue.

A 0x1D transaction whose framed sender is authorized under a WIP-1002 nullifier with sufficient remaining budget can be sent with zero ETH held by the sender — base fee, priority fee, L1 data fee, and operator fee are all subsidisable.

Trade-offs vs WIP-1003

  • No chain-wide baseFeePerGas = 0 pinning; protocol fee market untouched.
  • No virtual fee market or VirtualFeeOracle.
  • No per-block builder-owned subsidy-accounting transaction.
  • No mandated wallet RPC overrides.
  • The gasLimit vs gasUsed ambiguity in WIP-1003 §6 is resolved by construction: final settlement happens in reimburse_caller once gas_used is known.
  • Subsidy covers the full effective gas price plus L1 / operator fees; WIP-1003 covers only the (virtual) base fee.

Cost: scope is 0x1D only. WIP-1003 nominally applies to all tx types, though WIP-1002 authorization is keyed to WIP-1001 accounts so subsidy-eligible traffic is in practice a subset of 0x1D under either proposal.

WIP-1001 / WIP-1002 coordination needed

  • WIP-1001's pre-validation balance check ("worst-case payload gas charge + MIN_VALIDATION_FAILURE_FEE") must be made subsidy-aware so a 0-ETH sender can pass it.
  • WIP-1002's consumeBudget interface needs a wei-amount form — the existing consumeBudget(nullifier, gasUsed, baseFee) signature can't express a generic subsidy amount once priority/L1/operator fees are in scope.

The two are mutually exclusive realizations of Subsidy Enforcement; only one can ship.

Test plan

  • Spec review by core team
  • Decide between WIP-1003 and WIP-1004
  • Cross-check pre-charge / post-refund invariants with the WIP-1002 consumption interface change
  • Confirm the OP-Stack centralized-sequencer assumption documented in Security Considerations

@0xOsiris

Copy link
Copy Markdown
Contributor

Can you change to wip-1005 please

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