Skip to content

feat(test-node): emit MIDEN-funded genesis wallets when fees are enabled - #2466

Open
WiktorStarczewski wants to merge 5 commits into
nextfrom
wiktor/test-node-genesis-fee-funders
Open

feat(test-node): emit MIDEN-funded genesis wallets when fees are enabled#2466
WiktorStarczewski wants to merge 5 commits into
nextfrom
wiktor/test-node-genesis-fee-funders

Conversation

@WiktorStarczewski

Copy link
Copy Markdown
Contributor

The test node can now bring up a fee-charging chain that accounts can actually transact on.

  • MIDEN_TEST_NODE_VERIFICATION_BASE_FEE sets verification_base_fee in the generated genesis config. Unset (the default) is 0, so every existing test keeps its exact balances and behaviour.
  • When it is non-zero, genesis also emits two public MIDEN-funded wallets. Nothing can transact on a fee-charging chain without holding the native asset first, and a freshly created account cannot pay for its own deployment — so a harness needs an account it can draw on.
Why funders are needed at all, and why two

Since protocol 0.16 the fee is paid inside the account's auth procedure, which withdraws the native asset from the account's own vault before the rest of the transaction runs. An account with an empty vault therefore cannot transact at all, including to deploy itself. The escape is that a note's credit lands in the vault before pay_fee withdraws — so consuming a funding note is a transaction that settles its own fee. That only works if something can send the note, hence a funded genesis account.

They are public so their state is readable by a client that did not create them, which is what makes them usable as shared funders. Two, so a test needing a funder and a recipient does not have to serialise on one account's state; the amount is far above any plausible per-transaction fee so a long run cannot drain them.

Reviewers: the env-var-vs-config-field choice is the part worth your time — an env var keeps the default path byte-identical, but a genesis config field would be more discoverable.

@WiktorStarczewski
WiktorStarczewski marked this pull request as ready for review August 30, 2026 00:47
@WiktorStarczewski
WiktorStarczewski marked this pull request as draft August 30, 2026 11:43
@WiktorStarczewski
WiktorStarczewski marked this pull request as ready for review August 30, 2026 23:28
@WiktorStarczewski
WiktorStarczewski force-pushed the wiktor/test-node-genesis-fee-funders branch from cc19afa to a308ee1 Compare August 30, 2026 23:33
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.

1 participant