Skip to content

feat(network-monitor): add fees support - #2526

Open
SantiagoPittella wants to merge 1 commit into
nextfrom
santiagopittella-add-fees-to-monitor
Open

feat(network-monitor): add fees support#2526
SantiagoPittella wants to merge 1 commit into
nextfrom
santiagopittella-add-fees-to-monitor

Conversation

@SantiagoPittella

Copy link
Copy Markdown
Collaborator

Closes #2450

Summary

On fee-charging chains the monitor now funds its accounts from the faucet (reusing the existing PoW token-request flow) and keeps itself funded:

  • Wallet and counter are funded with public P2ID faucet notes, consumed as unauthenticated input notes by each account's first transaction (input-note assets land before the epilogue withdraws the fee, so empty-vault accounts bootstrap themselves).
  • The counter prices the increment note at the per-transaction fee bound, so every increment attaches a FEE_SPONSORSHIP note that pays for the network transaction consuming it. It also allowlists the sponsorship and P2ID scripts and carries BasicWallet (as does the wallet, to consume P2ID notes).
  • The wallet's fee balance is tracked, shown on the dashboard, and topped up automatically from the faucet when it runs low. A failed top-up flips the card unhealthy.
  • The fee asset is callback-enabled, so every transaction moving it must provision the issuing faucet as a foreign account. The monitor fetches the faucet's full state and witness at the reference block.
  • The remote-prover probe funds its payload the same way, but does not require re-funding since it never actually spends it. A fee-charging chain without --faucet-url fails the monitor at startup

Mainnet, which has no faucet, is a follow-up.

Also in this PR:

  • Genesis now pre-funds the native faucet's own vault with 1,000 MIDEN. Mint requests execute as network transactions paying fees from the faucet's vault, which was empty, so minting deadlocked on any fee-charging chain.
  • Bumped the miden protocol dependencies from 0.16.0-rc.4 to 0.16.0-rc.6 (version pins only, no code changes needed).
  • Zero-fee chains keep today's exact behavior.

TEsted it against a live local stack (fee-enabled genesis, base fee 500) with the faucet from 0xMiden/faucet#289: funding, deployment, increments with sponsorships, and automatic top-up all worked end to end.

Changelog

[[entry]]
scope       = "network-monitor"
impact      = "added"
description = "Support fee-charging chains: the monitor funds its accounts from the faucet, attaches fee sponsorships to increment notes, and tops its balance up automatically."

[[entry]]
scope       = "node"
impact      = "fixed"
description = "Pre-fund the generated native faucet's own vault at genesis so its mint network transactions can pay fees."

[[entry]]
scope       = "general"
impact      = "changed"
description = "Bump miden protocol dependencies to 0.16.0-rc.6."

@SantiagoPittella
SantiagoPittella force-pushed the santiagopittella-add-fees-to-monitor branch from b5e9f07 to 41c0222 Compare August 28, 2026 23:12
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.

Add fee support for network monitor

1 participant