You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
op-deployer: measure forge's peak memory instead of trusting forgeRunMemory #23995
op-deployer limits concurrent forge runs per host by memory, using a hard-coded estimate of one run's peak memory on contracts-bedrock: forgeRunMemory = 1536 << 20 (slots.go:42). slotCount divides the container's memory limit by it (slots.go:44-52).
Nothing keeps that value current. When contracts-bedrock grows, the real peak exceeds the estimate. Then too many forge runs share a CI container, and jobs are OOM-killed as flakes instead of failing with a clear message.
Proposal
Measure the peak, and fail a test when it nears the estimate:
After cmd.Run() in execWithEnv (client.go:429), read forge's peak RSS from cmd.ProcessState.SysUsage() (syscall.Rusage.Maxrss, KiB on Linux). Log it at debug level with the script name.
Expose the peak to tests, and assert in a test that runs a real contracts-bedrock script. For example, one of the live runs in integration_test/apply_test.go. It should fail when a run exceeds about 90% of forgeRunMemory, and the message should give the measured value to bump the constant to.
Done when
A forge run's peak memory is logged.
A test that runs in CI fails before the estimate goes stale.
🤖 Opus 5.5 says: Related: #24000 strips the AST from bundled artifacts, which cuts forge's peak memory from about 1.5 GB to about 0.37 GB per run. The check here should pin the new value.
Activity
sebastianst commentedon Nov 9, 2026
🤖 Opus 5.5 says: Related: #24000 strips the AST from bundled artifacts, which cuts forge's peak memory from about 1.5 GB to about 0.37 GB per run. The check here should pin the new value.