Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump ring size to 16 for v15 #8178

Merged
merged 1 commit into from
Apr 25, 2022

Conversation

j-berman
Copy link
Collaborator

@j-berman j-berman commented Feb 12, 2022

As per:


This PR follows the "double fork" pattern to allow ring sizes of either 11 or 16 during a grace period, and then requires 16. This way users of updated wallets who submit tx's right before the fork height that make it into the pool will still have their tx's processed.

Also removed the obsolete command to allow users to set a default ring size in the client. Updated wallets will start to use ring size 16 at the fork height.


I'm currently syncing the chain from scratch with this code as a sanity check. Currently on block ~2.3mn, which is after the latest fork. Will update here when finished. Update: synced from scratch successfully.

@rbrunner7
Copy link
Contributor

I tried to review but bumped against a partial lack of knowledge:

Is there an explanation somewhere about the meaning of unmixable and how a tx looks if I build it today that has such unmixable outputs? If not I would be glad for some short explanations; I tried to get the "mechanics" of unmixable / pre-RingCT / post-RingCT txs from the code alone but could not break through.

My current understanding that has still some holes in it sees errors both in the "old" now-active code as well as in your new code, but that does not seem very probable ...

@j-berman
Copy link
Collaborator Author

j-berman commented Mar 29, 2022

Is there an explanation somewhere about the meaning of unmixable and how a tx looks if I build it today that has such unmixable outputs?

Before RingCT, transparent amount outputs could only mix with other outputs of the same amount. Let's say back in the pre-RingCT days, I sent you an output worth 0.0004 Monero, and no other 0.0004 amount outputs ever came into existence in the chain (hypothetical). This 0.0004 Monero output would thus be "unmixable", since there wouldn't be 10+ other decoy outputs of the same amount with which you can mix this output. In this case, consensus allows you to construct a pre-RingCT transaction with a ring size of 1, where the 0.0004 amount output is used as an input, and pre-RingCT outputs come out on the other end.

To simulate this, you can set up a test network where you mine a bunch of pre-RingCT outputs, then advance the hard fork to current, then call sweep_unmixable in monero-wallet-cli and check the tx

Copy link
Contributor

@tobtoht tobtoht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed.

Copy link
Collaborator

@moneromooo-monero moneromooo-monero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The simplewallet default ring change has nothing to do with the ring size consensus change, and should not be in the same patch at all.
The other patch is pretty much pointless, but doesn't hurt I guess.
The rest looks good.

// The only circumstance where ring sizes less than expected are
// allowed is when spending unmixable non-RCT outputs in the chain.
// Caveat: at HF_VERSION_MIN_MIXIN_15, temporarly allow ring sizes
// of 10 are to allow a grace period in the transition to larger
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

11

@j-berman
Copy link
Collaborator Author

j-berman commented Apr 5, 2022

@moneromooo-monero depending on the value of DEFAULT_MIX, simplewallet wouldn't be able to construct tx's either before or after the fork (edit: unless the user enters a custom ring size). The fake_outs_count needs to be set using the height's fork rules (as is done in this PR as is via m_wallet->min_ring_size()), otherwise it would fail in one of these if statements. Given that, does the change to use min_ring_size() here belong in a different PR or did I misread that suggestion.. or am I missing something fundamental here?

Also, instead of getting rid of the command to set the default ring size in this PR, what if I just change the logic of set_default_ring_size to stop using the constants DEFAULT_MIX and MIN_RING_SIZE and always call m_wallet->min_ring_size()?

AFAICT, this ring size bump is the first one happening after the fixed ring size is already required by consensus, which is why I can't update the constants to the higher ring size in simplewallet (or leave them as is) otherwise people who start using the updated wallet before the fork height won't be able to construct tx's. That's why usage of the constants in simplewallet seemed worth updating in this PR (and I figured might as well just remove the command to set the default ring size instead of messing with that logic).

EDIT: it seems like it would eventually make sense to move away from min/max ring sizes/custom ring size setting in the wallet altogether (and only use a constant default), but curious on your thoughts for this PR

@moneromooo-monero
Copy link
Collaborator

I meant that two very different things should be in different patches. I'm fine with the change itself. But I see your point now, I guess it's ok since there is a good reason, which I did not realize before.

Copy link
Contributor

@rbrunner7 rbrunner7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked / reviewed again after rebase

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.

5 participants