Skip to content

fix(roa): increase account name retries - #627

Merged
huangminghuang merged 5 commits into
masterfrom
fix/wire-373-account-name-retries
Sep 17, 2026
Merged

huangminghuang merged 5 commits into
masterfrom
fix/wire-373-account-name-retries

Conversation

@huangminghuang

@huangminghuang huangminghuang commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Increase sysio.roa::newuser generated-account search from 3 to exactly 100 attempts while retaining deterministic bounded execution.
  • Mix the block number before combining it with the nonce so related name-valued nonces in different blocks do not alias to the same candidate sequence.
  • Use a non-narrowing attempt counter and derive the exhaustion diagnostic from the configured bound.
  • Cover forced collisions, block/nonce de-aliasing, the exact attempt bound, and complete generated-namespace exhaustion; clarify the action's documented failure conditions.
  • Refresh tracked contract artifacts from the ON/ON generation build.

Why

newuser previously rejected account creation after only three occupied generated names. Its seed also combined name-valued nonces and block numbers linearly, allowing related nonces in different blocks to walk the same candidate sequence and making retries substantially more likely than namespace occupancy alone would imply.

The revised generator decorrelates the block input and searches exactly 100 candidates. This preserves deterministic, bounded WASM execution while preventing avoidable sequence aliasing and making collision-induced rejection negligible until the creator's generated namespace is genuinely exhausted.

Validation

  • sysio_roa_tests: 70/70 cases and 1,428/1,428 assertions passed independently under sys-vm, sys-vm-jit, and sys-vm-oc.
  • Generated contract artifact parity: all tracked .wasm and .abi outputs match the ON/ON build outputs.

Change-Id: I920a29ab8cb377bb1571c29c4b414d04f9205ce1
@huangminghuang
huangminghuang requested a review from a team September 16, 2026 18:52

@heifner heifner left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Rebuilt every contract at this head: all 40 compiled artifacts reproduce byte-for-byte, and sysio.roa.wasm differs from master only in the loop bound and the message string. The other refreshes fix real staleness on master without changing chain behavior: sysio.msgch.wasm never picked up #579's chain_row change, the msgch/uwrit ABIs missed #609's three attestation types, and sendinline.wasm is function-order drift only. No snapshot, deep-mind or consensus reference data needs regenerating; those fixtures replay recorded blocks or never load roa. The new test fails against master's wasm and against a MAX_ACCOUNT_NAME_ATTEMPTS = 3 build, so it does exercise the retry path.

Inline comments cover the seed (the main source of retries), the constant's type and message, and test gaps. Also:

  • The newuser ricardian text in sysio.roa.hpp still says the action fails "if the account already exists". It retries instead, and fails when no free name turns up within MAX_ACCOUNT_NAME_ATTEMPTS candidates, on a reused nonce, for a creator name over 10 characters, or while ROA is inactive.
  • This doesn't change the WNS-30 exposure (each newuser still draws newaccount_ram from the shared sysio pool with no per-sponsor allowance), so it shouldn't count toward WIRE-373 despite the branch name.
  • Binary conflicts with #614 (roa), #594 (msgch, roa), #603 and #592 (msgch): whichever lands second needs to rebuild from the merged source rather than pick a side.

Comment thread contracts/sysio.roa/sysio.roa.cpp Outdated
Comment thread contracts/sysio.roa/sysio.roa.cpp Outdated
Comment thread contracts/sysio.roa/sysio.roa.cpp Outdated
Comment thread contracts/tests/sysio.roa_tests.cpp
…t-name-retries

Change-Id: I0d4839652cd77e2027a04e8ba1f93ab97c8b503b
…t-name-retries

Change-Id: If7a7a6667b226ba5c350e8d38becade720c68cbd
Change-Id: I05208d94d0ffa8aff28d7a84190b60e34cbf3707
…t-name-retries

Change-Id: I5574ace1ae317d26b3b64dacc942eac50881c585
@huangminghuang

Copy link
Copy Markdown
Contributor Author

Addressed the remaining review notes in follow-up commit 3205781 and pushed the current head b3e3e99. The newuser documentation now lists its actual failure conditions, and the generated contract artifacts were rebuilt after merging the latest master. On the branch name: GitHub closes an open PR when its head branch is renamed and does not support retargeting an existing PR head, so I retained the current branch to preserve PR #627 and its review history. The PR title and refreshed description present this as the standalone ROA account-name fix and do not claim it as a WIRE-373 mitigation. GitHub behavior: https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-branches-in-your-repository/renaming-a-branch

@huangminghuang
huangminghuang merged commit 8e8f027 into master Sep 17, 2026
12 checks passed
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.

2 participants