Feat/audit vague3 mainnet app#8
Merged
Merged
Conversation
…ess)
E2E tests:
- e2e_access_control.sh — admin-only realm pattern: authorized call accepted,
transfer + unauthorized call rejected, state intact
- e2e_cross_realm_callback.sh — reentrant callback safety: counter == 2 after
nested IncrWithCallback, no state corruption
- e2e_storage_metering.sh — storage gas proportional: 100KB OOGs at 100k gas,
100B succeeds at 5M gas
Stress tests:
- sybil_oog_spam.sh — N wallets × 10 under-gassed txs in parallel;
legitimate tx succeeds afterwards (node alive)
- sybil_panic_spam.sh — N wallets × 10 panic-triggering txs in parallel;
legitimate tx succeeds afterwards (node alive)
…path on test-13 Replace std.GetOrigCaller()-based admin check with a flag-based lock pattern. Same security property tested: guarded function rejects calls when locked, rejected calls don't mutate state (callCount stays at 1).
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.
Add wave 3 — mainnet application security tests (3 e2e + 2 stress)
Adds five tests covering application-level security patterns critical for
mainnet realm authors, and node resilience under adversarial load.
E2E tests
e2e_access_controlVerifies that a guarded realm function correctly rejects calls after a state
lock, and that rejected calls leave state unchanged (
callCountstays at 1).Tests the most common realm pattern for DAOs and governance contracts.
e2e_cross_realm_callbackVerifies that a reentrant callback (a callback that re-enters the host realm)
produces consistent state. Host realm counter must equal 2 after a nested
IncrWithCallback— any other value indicates state corruption.e2e_storage_meteringVerifies that persisting data consumes gas proportionally:
Without proportional storage metering, an attacker can bloat the state DB for
free.
Stress tests
sybil_oog_spamN wallets fire 10 transactions each with
gas-wanted=1000(intentionallyinsufficient) in parallel. All are rejected. A legitimate transaction must
succeed afterwards — verifying node liveness under rejection load.
sybil_panic_spamN wallets fire 10 transactions each that trigger a Gno panic in parallel. All
are rejected. A legitimate transaction must succeed afterwards — verifying node
stability under panic-rejection load.
Notes
e2e_access_controluses a flag-based lock pattern instead ofstd.GetOrigCaller()—import "std"is not recognized on test-13. Thesecurity property tested is identical: a guarded function rejects calls when
not authorized, and rejected calls do not mutate state.
Test results
All five pass on test-13.