Skip to content

[Testing] Restore exact EVM updated-register count assertion - #8629

Open
janezpodhostnik wants to merge 1 commit into
janez/flaky-test-followup-spam-boundaryfrom
janez/flaky-test-followup-evm-registers
Open

[Testing] Restore exact EVM updated-register count assertion#8629
janezpodhostnik wants to merge 1 commit into
janez/flaky-test-followup-spam-boundaryfrom
janez/flaky-test-followup-evm-registers

Conversation

@janezpodhostnik

@janezpodhostnik janezpodhostnik commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #8626, which relaxed assert.Len(state.UpdatedRegisterIDs(), 13) to
NotEmpty in the COA dryCall tests because the count varied between runs — losing the
ability to catch write-amplification regressions.

The variance is now fully characterized: the test env uses a random block ID, and
environment.uuidPartition (= sha256(blockID)[0] at txnIndex 0) selects the UUID
register. Partition 0 (probability 1/256) reuses the legacy uuid register → 12 updated
registers; all other partitions create a fresh uuid_N register → 13. This 1-in-256 case
is what made the original exact assertion flaky.

This PR restores an exact assertion via a small helper that computes the expected count
(12 or 13) from the block ID, keeping the fixture's full randomness. Both branches
verified: 15 random-block runs and 3 runs with partition 0 forced, all with -race.

Test-only change; no production code touched.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@janezpodhostnik
janezpodhostnik requested a review from a team as a code owner July 29, 2026 16:01
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 849b6878-c62f-4e02-bece-39a8a0fe161f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@m-Peter m-Peter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@janezpodhostnik janezpodhostnik changed the title Restore exact EVM updated-register count assertion [Testing] Restore exact EVM updated-register count assertion Jul 31, 2026
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.

3 participants