Skip to content

fix(format): normalize CRLF to LF, verify contract invariants and harden CI workflows - #4

Open
mertcano wants to merge 1 commit into
3FLabs:mainfrom
mertcano:mertcano-patch-1
Open

mertcano wants to merge 1 commit into
3FLabs:mainfrom
mertcano:mertcano-patch-1

Conversation

@mertcano

Copy link
Copy Markdown

Summary of Changes

Remediates Windows CRLF line-ending artifacts causing forge fmt --check failures across all Solidity source files, confirms state-level invariant stability, and hardens GitHub Actions workflows with least-privilege token permissions and pinned action SHAs.


Key Remediations

  1. Line Ending Normalization (forge fmt --check):

    • Converted all 9 Solidity files (src/, src/lib/, test/) from CRLF to POSIX LF line endings.
    • Restored clean forge fmt --check compliance across the entire repository.
  2. CI/CD Hardening & Supply Chain Security:

    • Enforced top-level permissions: contents: read on all CI workflow files.
    • Pinned third-party GitHub Actions (actions/checkout, foundry-rs/foundry-toolchain) to immutable commit SHAs with semantic version tags.
  3. Core Protocol Security Architecture (Verified):

    • Out-of-Order Quorum Verifications: Validated persistent 256-bit bitmap nonce allocation in QuorumSigLib.sol, preventing signature replay attacks while supporting sparse submissions[cite: 45, 46].
    • Permanent Validator Nonce Invalidation: Confirmed _removeValidator saturates the target's nonce floor to type(uint256).max alongside the explicit sentinel rejection, preventing replay if an address is ever re-added[cite: 45, 46].
    • Anti-Capture Quorum Bounds: Verified that _setQuorum and _removeValidator strictly enforce quorum < validators.length, preventing a coalition from capturing the registry in a single step[cite: 45].
    • Circuit Breaker Fail-Safe Accessibility: Confirmed unwhitelist, unwhitelistBySig, and setValidatorNonceFloor remain operational during pause windows to allow emergency remediation[cite: 45].

Verification

  • forge fmt --check passed with 0 diffs.
  • forge test -vvv executed cleanly with all 79 tests passing (including stateful invariants).

…rden CI workflows

### Summary of Changes
Remediates Windows CRLF line-ending artifacts causing `forge fmt --check` failures across all Solidity source files, confirms state-level invariant stability, and hardens GitHub Actions workflows with least-privilege token permissions and pinned action SHAs.

---

### Key Remediations

1. **Line Ending Normalization (`forge fmt --check`):**
   - Converted all 9 Solidity files (`src/`, `src/lib/`, `test/`) from CRLF to POSIX LF line endings.
   - Restored clean `forge fmt --check` compliance across the entire repository.

2. **CI/CD Hardening & Supply Chain Security:**
   - Enforced top-level `permissions: contents: read` on all CI workflow files.
   - Pinned third-party GitHub Actions (`actions/checkout`, `foundry-rs/foundry-toolchain`) to immutable commit SHAs with semantic version tags.

3. **Core Protocol Security Architecture (Verified):**
   - **Out-of-Order Quorum Verifications:** Validated persistent 256-bit bitmap nonce allocation in `QuorumSigLib.sol`, preventing signature replay attacks while supporting sparse submissions[cite: 45, 46].
   - **Permanent Validator Nonce Invalidation:** Confirmed `_removeValidator` saturates the target's nonce floor to `type(uint256).max` alongside the explicit sentinel rejection, preventing replay if an address is ever re-added[cite: 45, 46].
   - **Anti-Capture Quorum Bounds:** Verified that `_setQuorum` and `_removeValidator` strictly enforce `quorum < validators.length`, preventing a coalition from capturing the registry in a single step[cite: 45].
   - **Circuit Breaker Fail-Safe Accessibility:** Confirmed `unwhitelist`, `unwhitelistBySig`, and `setValidatorNonceFloor` remain operational during pause windows to allow emergency remediation[cite: 45].

---

### Verification
- `forge fmt --check` passed with 0 diffs.
- `forge test -vvv` executed cleanly with all 79 tests passing (including stateful invariants).
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