Skip to content

Build Denial-of-Service, Gas-Griefing, and Unbounded-Work Analysis #80

Closed

Description

@Nanle-code

Summary

Implement a production-grade denial-of-service, gas-griefing, and unbounded-work analysis for StellarChainproofs/ChainProof. This issue is a complete engineering track rather than a narrow detector patch: it requires durable TypeScript architecture, integrated workflows, comprehensive validation, tests, fixtures, and documentation.

Problem statement

Loops, dynamic storage, callback fan-out, revert propagation, and attacker-controlled work can make critical operations impossible even when no direct asset theft occurs.

Required scope

  • Identify loops and recursion whose bounds derive from user-controlled or unbounded persistent data.
  • Track attacker-controlled array growth, iteration, external-call fan-out, returndata copying, event volume, and storage clearing.
  • Detect push-payment patterns, unexpected revert propagation, insufficient gas forwarding, return bombs, and block gas limit dependence.
  • Estimate symbolic upper bounds where possible and attach uncertainty when constraints cannot be proven.
  • Recognize pagination, pull payments, bounded batches, failure isolation, and other mitigation patterns.
  • Test governance execution, reward distribution, liquidation queues, enumerable sets, malicious recipients, return bombs, and safe chunked designs.

Acceptance criteria

  • The capability is exposed through coherent @chainproof/core APIs and appropriate CLI, server, editor, action, or plugin surfaces with stable versioned output.
  • Analysis behavior is deterministic by default, bounded against adversarial input, and accompanied by precise source locations, evidence paths, assumptions, and confidence where applicable.
  • Core logic is separated from transport and presentation layers and does not require external network services in CI.
  • New configuration, caches, databases, manifests, or report formats are versioned and include validation, migration, and corruption handling.
  • Errors preserve actionable context without leaking source, credentials, local paths, provider data, or other sensitive information.
  • Tests include vulnerable and secure fixtures, false-positive controls, malformed input, boundary conditions, failure recovery, and performance safeguards.
  • Public APIs and CLI behavior are documented with security assumptions, compatibility constraints, examples, and operational troubleshooting.

Required deliverables

  • Production TypeScript implementation placed in the appropriate packages/core, packages/cli, packages/server, packages/vscode-extension, packages/github-action, or clearly justified new workspace package.
  • Typed public interfaces, structured diagnostics, deterministic serialization, resource limits, cancellation, and recovery behavior appropriate to the feature.
  • Unit, integration, CLI, adversarial, and regression tests plus vulnerable and secure Solidity fixtures or protocol test doubles.
  • Documentation for users, rule authors, integrators, and maintainers, including threat model, limitations, compatibility, migration, and troubleshooting.
  • A pull-request description explaining architecture, precision/recall considerations, security boundaries, performance measurements, test evidence, and follow-up work.

Integration boundaries

This is deterministic liveness and resource analysis, not the AI gas optimization track in #54.

Avoid unrelated rewrites, placeholder detectors, hidden live-network dependencies, dead code, and changes that weaken existing rules, type safety, security controls, or test coverage.

Minimum implementation requirement

This is intentionally a substantial contributor project. A mergeable pull request must add at least 1,000 lines of meaningful production implementation code for this issue. The minimum excludes tests, documentation, comments-only changes, generated output, vendored code, Solidity fixtures, snapshots, lockfiles, formatting-only churn, and unrelated refactors. Do not pad the implementation to reach the threshold; the required behavior must justify the code through cohesive, maintainable functionality.

CI and conflict-free merge gate

A pull request must not be merged until every required CI check passes on the final commit. At minimum, contributors must preserve a green result for the repository's applicable gates:

  • npm ci
  • npm run lint
  • npm run build
  • npm run test
  • npm run test:ci --workspace=packages/core
  • Package-specific build and test commands for every affected workspace
  • The existing ChainProof audit workflow and API documentation build when applicable

Any new workspace, command, detector, report format, plugin capability, server route, compiler adapter, or CI provider integration requires targeted automated coverage. Contributors may not disable tests, relax type or lint rules, reduce coverage, suppress legitimate failures, or alter CI merely to obtain a passing result.

The final PR branch must be updated against the target branch and have no merge conflicts. If rebasing or updating changes the final commit, all required CI checks must run again and pass before merge.

Activity

  1. covenantalade commented on Aug 30, 2026

    @covenantalade
    Contributor

    I’d like to contribute to #80 — Build Denial-of-Service, Gas-Griefing, and Unbounded-Work Analysis.

    My background in smart-contract security, protocol auditing, Rust/TypeScript development, and Web3 infrastructure makes this a particularly strong fit for me. In security reviews, I’ve worked with execution paths, attacker-controlled inputs, state transitions, resource constraints, and invariant-based reasoning, so I’m interested in extending that mindset into deterministic liveness and resource analysis.

    I would approach this as an analysis pipeline rather than a collection of isolated detectors. The implementation would model how attacker-controlled state and inputs influence loops, recursion, storage growth, external-call fan-out, returndata handling, event generation, and other potentially unbounded work.

    Key areas I would focus on include:

    • Detecting loops and recursive paths whose bounds depend on user-controlled or persistent state.
    • Tracking attacker-controlled collection growth and propagation into expensive operations.
    • Analyzing external-call fan-out, return-data copying, storage clearing, and event volume.
    • Identifying push-payment and revert-propagation patterns that can make critical operations fail or become griefable.
    • Modeling gas-forwarding behavior and block-gas-limit-dependent execution.
    • Producing symbolic upper-bound estimates where possible, while clearly representing uncertainty when bounds cannot be proven.
    • Recognizing mitigations such as pagination, pull-based payments, bounded batches, chunked processing, and failure isolation.
    • Building vulnerable and secure Solidity fixtures covering governance execution, reward distribution, liquidation queues, enumerable structures, malicious recipients, return bombs, and safe bounded designs.

    I’ll keep the analysis deterministic and bounded itself, with the core logic separated from transport and presentation. Findings will include precise source locations, evidence paths, assumptions, and useful diagnostics so they can be consumed consistently by the CLI and other ChainProof surfaces.

    I’ll also prioritize false-positive control and regression testing, since resource-analysis rules can easily become noisy if they rely only on syntactic patterns. External dependencies will be mocked or fixture-driven so CI remains deterministic.

    I’m prepared to work within the existing ChainProof architecture, preserve current security controls, and validate the implementation against all applicable lint, build, test, audit, and documentation checks without weakening the existing CI gates.

  2. grantfox-oss commented on Aug 30, 2026

    @grantfox-oss

    🦊 GrantFox — @covenantalade has been assigned to this issue as part of the Third Campaign campaign!

    Next steps:

    1. Open a Pull Request referencing this issue (e.g., Closes #80)
    2. Your PR will be reviewed by the StellarChainproof maintainers

    Good luck! Track your progress on GrantFox.

  3. added 2 commits that reference this issue on Aug 30, 2026
  4. grantfox-oss commented on Aug 30, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox as part of the Third Campaign campaign!

    @covenantalade's PR #114 was approved and merged by @Nanle-code.

    🏆 @covenantalade: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (424 total points). Track your full progress on GrantFox.

    👏 Great work, @covenantalade! Keep contributing to StellarChainproof.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third CampaignenhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions