feat: add wip-1004 subsidy enforcement via handler hooks#649
Open
kilianglas wants to merge 1 commit into
Open
Conversation
Contributor
|
Can you change to wip-1005 please |
0xOsiris
approved these changes
May 27, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds WIP-1004, an alternative realization of subsidy enforcement to WIP-1003. Scoped to WIP-1001
0x1Dtransactions and realized through three op-revmHandlerhook 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 inreward_beneficiaryare 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
baseFeePerGas = 0pinning; protocol fee market untouched.VirtualFeeOracle.gasLimitvsgasUsedambiguity in WIP-1003 §6 is resolved by construction: final settlement happens inreimburse_calleroncegas_usedis known.Cost: scope is
0x1Donly. 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 of0x1Dunder either proposal.WIP-1001 / WIP-1002 coordination needed
consumeBudgetinterface needs a wei-amount form — the existingconsumeBudget(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