feat(local-env): end-to-end stress harness covering all merged PRs (132-138)#143
Open
tangletools wants to merge 1 commit into
Open
feat(local-env): end-to-end stress harness covering all merged PRs (132-138)#143tangletools wants to merge 1 commit into
tangletools wants to merge 1 commit into
Conversation
Single-file harness at scripts/local-env/stress-test.sh that boots a fresh anvil + LocalTestnet deployment and walks 17 ordered economic checks against the merged-PR surface (#132 subscription billing rearchitecture, #133 multi-asset bill weighting + EIP-170 facet split, #134 O(1) operator stake aggregate + share-pool slashing, #136 claimRewardsAll griefing isolation, #138 indexer event handlers). Highlights: - Idempotent: clean cleanup of anvil, broadcast artifacts, indexer state. - Per-step pass/fail with timing + headline metric. Single-line summary. - Optional --with-indexer / --with-dapp / --with-operator flags for the off-chain side processes; none required for the 17-step protocol surface. - Griefing-token isolation step deploys a RevertingTransferERC20 and seeds Tangle's _pendingRewards + _pendingRewardTokens AddressSet via anvil_setStorageAt (vm.store from a broadcast script doesn't propagate to anvil; the harness drives the seed via curl directly). Companion docs at scripts/local-env/STRESS-TEST.md cover prereqs, per-step PR mapping, log locations, debugging recipes, and an extension guide. A full green run takes ~40-85s on a warm-cache checkout.
Contributor
Author
🔍 Reviewing
|
| Pass | Status | ETA |
|---|---|---|
| Kimi Code K2.6 | Running (2 min) | ~5-15 min |
| opencode GLM 5.1 | Running (2 min) | ~5-15 min |
Agent review running. Reads the actual code. This comment updates in place.
tangletools · #143 · model: kimi-for-coding · started 2026-05-16T10:41:32Z
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.
Summary
Single-file local stress harness at
scripts/local-env/stress-test.shplus a runbook atscripts/local-env/STRESS-TEST.md. Boots a fresh anvil +LocalTestnet.s.soldeployment in subscription mode and walks 17 ordered economic checks against the merged-PR surface. Average wall time on a warm-cache checkout: ~40-85s.[OK]/[FAIL]lines with timing + a one-line headline metric (e.g.draw1=80909090909090909 wei,actualSlashed=3150000000000000000 wei).RESULT: N / 17 OK in Xssummary; exit0⇔ all green.--with-indexer/--with-dapp/--with-operatorfor the off-chain side processes; none required for the 17 protocol-surface assertions.Steps + which PR each step validates
LocalTestnet.s.solruns in subscription mode (#132 baseline)isOperatorRegistered(0, op2)(#132 setup)isServiceActive(0)+ baseline pinned (#132)isServiceOperator(0, op2)— ApprovalsViews split clean (#133)getServiceEscrow(0).balance > 0MultiAssetDelegation.depositAndDelegateliftsgetOperatorDelegatedStake(#134 O(1) aggregate)TIMESTAMP_BUFFERrespected,actualSlashed > 0(#134 share-pool slashing)getOperatorDelegatedStakestrictly drops (#134)pendingRewards(op2, 0x0)RevertingTransferERC20seeded viaanvil_setStorageAtinto_pendingRewards[op2][grief]+_pendingRewardTokens[op2];claimRewardsAlliterates, isolates the revert, emitsRewardsClaimSkippedand leaves the entry intact for retry (#136)--with-indexer: at least one row each inOperator,Service,ServiceOperator,SubscriptionBilling,PaymentDistribution,RewardClaim,RewardsClaimSkip(#138),SlashProposal,OperatorPoolSlash(#138)Implementation notes worth flagging at review:
vm.storefrom a broadcast forge script does not propagate to anvil. The griefing seed (step 16) needsanvil_setStorageAtto actually mutate live storage — so the slot computation runs from bash and the forge helper (script/StressGriefingSeed.s.sol) only deploys the reverting ERC20.forge inspect Tangle storage-layoutat this commit (_pendingRewardsat slot 44,_pendingRewardTokensat slot 64). If those move, step 16 will print the discovered value so the slot constant can be re-derived. Runbook documents the procedure.Test plan
--with-indexerflag runs 17/17 including indexer entity checks. (Out of scope for this PR — the worktree's pnpm/envio bootstrap is finicky; runbook documents the workaround.)--with-dapp/--with-operatorsmoke (these are best-effort; failures do not affect the harness pass/fail).