Repository navigation
automint does not leave room for the mint fee - #1093
Open
whiskyrelaxing wants to merge 1 commit into
Open
whiskyrelaxing wants to merge 1 commit into
whiskyrelaxing wants to merge 1 commit into
Conversation
ohcee
reviewed
Nov 5, 2026
ohcee
left a comment
Collaborator
There was a problem hiding this comment.
utACK 459fe70
Math checks out, the fee is per mint (consensus enforces nFees == nMints * Zerocoin_MintFee()), so denom + fee is the real cost of one mint and the batch always fits. The delay reset on failure is worth having on its own.
One suggestion: the two "less than the selected denomination plus its fee" returns still retry every block, give them the same nAutoMintStartupTime reset to finish the de-spam.
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.
Every mint costs its denomination plus Zerocoin_MintFee(), and both come out of
the same balance. automint only ever sizes against the denomination, so when the
scaling fills the balance there is nothing left for the fee and the mint is
refused.
The check at wallet.cpp:5233 runs before the scaling, so it tests one
denomination's worth:
div multiplies nMintAmount up to fill the balance, nothing checks again, and
MintZerocoin then wants nValue + Zerocoin_MintFee() and refuses at
wallet.cpp:6105.
So it fails whenever the mintable balance is an exact multiple of the
denomination, for any denomination, up to nine times it. At ten times and above
the div > 9 clamp happens to leave the fee behind, which is the only reason this
is not constant.
While it is failing it retries on every block rather than every five minutes,
because the retry delay is only reset in the success branch at wallet.cpp:5282,
so nWaitTime keeps growing and AUTOMINT_DELAY stops holding it back:
Two changes. The sizing uses the cost of one mint including its fee, for the
check and the scaling. And a failed mint resets the delay, which is worth having
on its own since it applies to any failure, not just this one.