Skip to content

fix: root volume size unreachable on the sweep launch path (#544, #545) - #546

Merged
scttfrdmn merged 2 commits into
mainfrom
fix/544-545-sweep-volume-size
Aug 20, 2026
Merged

scttfrdmn merged 2 commits into
mainfrom
fix/544-545-sweep-volume-size

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Summary

Changes

  • cmd/sweep.go: added parseVolumeSizeGiB (numeric-shape parsing matching parseCostLimit's convention — int/float/json.Number/string, plus int32 for the CLI-flag route) and a volume_size case in buildLaunchConfigFromParams's switch.
  • cmd/launch_sweep.go: added applyCLIVolumeSizeToSweep, wired in before the detached/foreground dispatch, same seam as applyCLISpendControlsToSweep/applyCLIIAMToSweep.
  • cmd/sweep_keys.go: volume_size moved from reservedRowKeys (rejected) to recognizedRowKeys (real key); disk_size's message corrected to point at volume_size: instead of --disk-size.
  • CHANGELOG.md: ### Fixed entry under [Unreleased] covering both issues.

Structural guard test (not added — rationale)

The issue suggested a test walking launchCmd.Flags() to assert sweep-path coverage of every flag. I scoped this out: launchCmd registers ~130 flags, many legitimately CLI-only or applied via baseConfig copy rather than a defaults: fold (--interactive, --wait-for-running, --mode, --regions-*, --strata-*, --nist-*, etc.). A blanket assertion would need a large, hand-maintained allowlist to avoid false positives — itself a nontrivial design task — so I left it out of scope for this fix rather than ship a low-signal guard.

Test plan

  • New unit tests in cmd/sweep_volume_size_test.go: precedence (row > CLI > file), row-still-wins, real-key-not-passthrough, bad-value errors, parseVolumeSizeGiB shape coverage.
  • cmd/sweep_keys_test.go: added disk_size case to TestClassifyRowKeyRejects, plus TestVolumeSizeIsNoLongerRejected and TestDiskSizeMessageNamesTheRealFlag.
  • New Tier 0 e2e test test/e2e/tier0_sweep_volume_size_test.go. Since Substrate (pinned v0.97.0) doesn't wire RunInstances' BlockDeviceMappings into any queryable DescribeVolumes record (confirmed empirically — a launch with --volume-size 77 followed by DescribeVolumes returns zero volumes), these tests use a small recording reverse-proxy that decodes the real BlockDeviceMapping.1.Ebs.VolumeSize off the wire-level RunInstances request and forwards it unmodified to Substrate — strictly stronger than a DescribeVolumes assertion would have been.
  • Fail-without/pass-with verified: reverted the fix locally, confirmed old binary (a) launches with the hardcoded 20 GiB default even with --volume-size 60, and (b) rejects volume_size: in a param file with the old --disk-size message; restored the fix and confirmed all 4 new Tier 0 tests pass.
  • make check clean.
  • make check-docs clean (flag help text unchanged, no doc drift).
  • All 10 nested lambda/*/go.mod modules build clean (go -C lambda/<dir> build ./...), no drift.
  • Full Tier 0 suite (go test -tags=e2e_tier0 ./test/e2e/...) green.

Cost safety: one real-AWS verification instance was launched and independently confirmed terminated during manual testing (before switching entirely to Substrate-backed testing for the remainder of this work).

--volume-size was registered and read on the single-instance launch path
but never referenced by launch_sweep.go, and the param-file equivalent,
volume_size:, was actively rejected with a message naming "--disk-size" —
a flag that has never existed in this codebase (#545). Every sweep row
launched at spawn's hardcoded 20 GiB default regardless of what was asked
for, the fourth occurrence of this bug class this week (#524, #525, #539).

Wires --volume-size and volume_size: into the sweep path following the
same applyCLI*ToSweep pattern #525/#539 established: fold the CLI flag
into paramFormat.Defaults before the orchestration-path dispatch, with
precedence row > CLI flag > file defaults. disk_size: remains a rejected
near-miss, now pointing at the real key instead of the nonexistent flag.
@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.37209% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/sweep.go 88.57% 3 Missing and 1 partial ⚠️
cmd/launch_sweep.go 87.50% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

…ss finding (#544)

strconv.Atoi returns int, and the int32(n) conversion right after it tripped
trailofbits.go.string-to-int-signedness-cast. strconv.ParseInt(s, 10, 32)
does the same bounded parse without a follow-on cast; same behavior for
every value RunInstances' BlockDeviceMapping.1.Ebs.VolumeSize can carry.
@scttfrdmn
scttfrdmn merged commit bef379e into main Aug 20, 2026
7 checks passed
@scttfrdmn
scttfrdmn deleted the fix/544-545-sweep-volume-size branch August 20, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant