Skip to content

Re-simulate the custom account test in enforcing auth mode - #206

Merged
christian-rogobete merged 1 commit into
mainfrom
custom-account-test-enforce-simulation
Nov 11, 2026
Merged

christian-rogobete merged 1 commit into
mainfrom
custom-account-test-enforce-simulation

Conversation

@christian-rogobete

Copy link
Copy Markdown
Member

Before this change, the custom account integration test padded the recording-mode simulation with fixed factors: four times the instructions, three times the disk read bytes and a fixed fee. It also built the footprint by hand, because that simulation does not run the account contract's __check_auth. On testnet under Protocol 30 the padded budget was too small: add_limit failed with resource_limit_exceeded inside __check_auth, 2,084,115 instructions consumed against 1,616,672 declared.

This change:

  • Signs the auth entries, re-simulates the transaction in enforcing auth mode and takes that footprint, resources, and fee, for add_limit and for transfer.
  • Asserts the rejection of the over-limit transfer with one signer on the enforcing simulation's result error (Error(Auth, InvalidAction) with the contract's error 3) and no longer submits it.
  • Removes the padding, the hand-built footprint keys and two unused imports.

Verified on testnet: the class passed three times on this tree, the enforcing simulation of add_limit at 2,283,077 instructions. Unit suite and static analysis green.

Before this change, the custom account integration test padded the
recording-mode simulation with fixed factors: four times the
instructions, three times the disk read bytes and a fixed fee. It also
built the footprint by hand, because that simulation does not run the
account contract's __check_auth. On testnet under Protocol 30 the padded
budget was too small: add_limit failed with resource_limit_exceeded
inside __check_auth, 2,084,115 instructions consumed against 1,616,672
declared.

This change:
- Signs the auth entries, re-simulates the transaction in enforcing auth
  mode and takes that footprint, resources, and fee, for add_limit and
  for transfer.
- Asserts the rejection of the over-limit transfer with one signer on
  the enforcing simulation's result error (Error(Auth, InvalidAction)
  with the contract's error 3) and no longer submits it.
- Removes the padding, the hand-built footprint keys and two unused
  imports.

Verified on testnet: the class passed three times on this tree, the
enforcing simulation of add_limit at 2,283,077 instructions. Unit suite
and static analysis green.
@codecov

codecov Bot commented Nov 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.47%. Comparing base (fb1224d) to head (122efad).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##               main     #206   +/-   ##
=========================================
  Coverage     93.47%   93.47%           
  Complexity    21622    21622           
=========================================
  Files          1006     1006           
  Lines         52424    52424           
=========================================
  Hits          49003    49003           
  Misses         3421     3421           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@christian-rogobete
christian-rogobete merged commit 03d65a4 into main Nov 11, 2026
9 of 10 checks passed
@christian-rogobete
christian-rogobete deleted the custom-account-test-enforce-simulation branch November 11, 2026 16:16
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