Skip to content

Add feature flag to skip checksum validation for faster development boot#21645

Open
dwelch-r7 wants to merge 1 commit into
rapid7:masterfrom
dwelch-r7:skip-checksum-option
Open

Add feature flag to skip checksum validation for faster development boot#21645
dwelch-r7 wants to merge 1 commit into
rapid7:masterfrom
dwelch-r7:skip-checksum-option

Conversation

@dwelch-r7

Copy link
Copy Markdown
Contributor

Description

Add a skip_checksum_validation feature flag that skips module file checksum validation during boot.

On every startup, msfconsole stat's all files under modules/ and computes CRC32 checksums to detect whether any module files have changed since the last boot. If files changed, it forces a full (non-deferred) module reload. This costs ~250ms per boot even when no files have changed, purely from the filesystem traversal and checksum comparison.

For developers who iterate frequently on the framework itself (not module files), this check is unnecessary overhead — they can run reload_all when they've actually modified modules. This flag lets them skip it.

Related to: #21639

Verification Steps

    • Start msfconsole normally — boot behavior is unchanged (flag is off by default)
    • Run features in msfconsole — confirm skip_checksum_validation appears in the list, disabled
    • Run features set skip_checksum_validation true save, then restart msfconsole — confirm it boots faster
    • With the flag enabled, modify a module file (e.g. touch modules/exploits/multi/handler.rb), restart — confirm the change is NOT auto-detected (deferred load still used)
    • Run reload_all — confirm modules reload correctly
    • Run bundle exec rspec spec/lib/msf/ui/console/driver_skip_checksum_spec.rb — 3 examples pass
    • Run bundle exec rspec spec/lib/msf/core/feature_manager_spec.rb — all existing tests pass

Test Evidence

Before:

Benchmark 1: bundle exec ruby ./msfconsole -q -x 'exit'
  Time (mean ± σ):      4.207 s ±  0.055 s    [User: 2.975 s, System: 1.307 s]
  Range (min … max):    4.151 s …  4.330 s    10 runs

After:

Benchmark 1: bundle exec ruby ./msfconsole -q -x 'exit'
  Time (mean ± σ):      3.904 s ±  0.060 s    [User: 2.811 s, System: 1.123 s]
  Range (min … max):    3.816 s …  3.997 s    10 runs

Environment

Field Details
Operating System macOS (26.5.2)
Target Software/Hardware Metasploit Framework (Ruby 3.3.8)

AI Usage Disclosure

Kiro

Pre-Submission Checklist

  • No sensitive information (IP addresses, credentials, API keys, hashes) in code or documentation
  • Tested on the target environment specified in the Environment section above
  • Included RSpec tests for library changes
  • Read the CONTRIBUTING.md and module acceptance guidelines

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

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants