Skip to content

fix: altvm file submitter#7990

Merged
troykessler merged 4 commits intomainfrom
fix/altvm-file-submitter
Feb 4, 2026
Merged

fix: altvm file submitter#7990
troykessler merged 4 commits intomainfrom
fix/altvm-file-submitter

Conversation

@troykessler
Copy link
Contributor

@troykessler troykessler commented Feb 2, 2026

Description

This PR fixes a bug where the cli throws if the altvm file submitter opens an empty file due to expecting valid json/yaml content.

Drive-by changes

Related issues

Backward compatibility

Testing

Summary by CodeRabbit

  • Bug Fixes

    • Reduced noisy error logging and improved behavior when the AltVM file submitter encounters an initially empty or invalid file, allowing processing to continue gracefully.
  • Chores

    • Released a patch for the deploy SDK incorporating the above logging change.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 2, 2026

📝 Walkthrough

Walkthrough

A patch changes AltVMFileSubmitter's error logging when reading existing transaction files: invalid or empty initial files no longer log an error; the write path and control flow remain unchanged. A changeset declaring a patch release for @hyperlane-xyz/deploy-sdk was added.

Changes

Cohort / File(s) Summary
Changeset
\.changeset/big-yaks-protect.md
Adds a patch changeset for @hyperlane-xyz/deploy-sdk describing the fix for AltVMFileSubmitter file-submit behavior.
File Submitter Logic
typescript/deploy-sdk/src/AltVMFileSubmitter.ts
Lowered logging level in the catch block when reading existing transaction files (error → debug); no control-flow or write-path changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • ltyu
  • xeno097
  • antigremlin
  • yorhodes

Poem

A quiet tweak in the swampy log heap,
No more ruckus when the read's half-asleep,
The write still moseys in, steady and true,
Small change, same stride — business as due,
Cheers, now the logs mind their manners too.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the main bug fix clearly but leaves several required template sections incomplete: Drive-by changes, Related issues, Backward compatibility, and Testing are all unaddressed. Complete the remaining template sections by specifying if there are drive-by changes, referencing related issues if applicable, and clarifying backward compatibility and testing approach.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: altvm file submitter' directly matches the main change: replacing an error log with a debug log in the AltVMFileSubmitter when handling invalid transactions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/altvm-file-submitter

Important

Action Needed: IP Allowlist Update

If your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:

  • 136.113.208.247/32 (new)
  • 34.170.211.100/32
  • 35.222.179.152/32

Reviews will stop working after February 8, 2026 if the new IP is not added to your allowlist.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
typescript/deploy-sdk/src/AltVMFileSubmitter.ts (1)

31-41: ⚠️ Potential issue | 🟡 Minor

Don’t silently swallow non-empty read errors.

Right now the bare catch hides parse/permission problems and then overwrites the file with no signal. That’s risky if the file isn’t empty but corrupted. A simple guard keeps the empty-file behavior while still warning on real read failures.

🧰 Suggested adjustment
+import { existsSync, statSync } from 'fs';
 import { readYamlOrJson, writeYamlOrJson } from '@hyperlane-xyz/utils/fs';
@@
-    try {
-      const maybeExistingTxs = readYamlOrJson(filepath); // Can throw if file is empty
-      assert(
-        Array.isArray(maybeExistingTxs),
-        `Target filepath ${filepath} has existing data, but is not an array. Overwriting.`,
-      );
-      allTxs.unshift(...maybeExistingTxs);
-    } catch {
-      // if file is empty we simply continue and write the first contents of the file below
-    }
+    try {
+      if (existsSync(filepath) && statSync(filepath).size > 0) {
+        const maybeExistingTxs = readYamlOrJson(filepath);
+        assert(
+          Array.isArray(maybeExistingTxs),
+          `Target filepath ${filepath} has existing data, but is not an array. Overwriting.`,
+        );
+        allTxs.unshift(...maybeExistingTxs);
+      }
+    } catch (err) {
+      this.logger.warn({ err }, `Failed to read existing txs at ${filepath}. Overwriting.`);
+    }

Copy link
Contributor

@antigremlin antigremlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please explain what the bug was.

@troykessler
Copy link
Contributor Author

Please explain what the bug was.

Added more context in the pr description

Copy link
Contributor

@antigremlin antigremlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the changeset

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.changeset/big-yaks-protect.md:
- Line 5: Update the changeset description to past tense by changing the
summary/title line "fix: replace error with debug log in altvm file submitter"
to use past tense (e.g., "fix: replaced error with debug log in altvm file
submitter") so the changeset describes what changed; edit the
.changeset/big-yaks-protect.md file and update that heading string accordingly.

@troykessler troykessler added this pull request to the merge queue Feb 4, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 4, 2026
@paulbalaji paulbalaji added this pull request to the merge queue Feb 4, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 4, 2026
@troykessler troykessler added this pull request to the merge queue Feb 4, 2026
Merged via the queue into main with commit 9c52a94 Feb 4, 2026
116 checks passed
@troykessler troykessler deleted the fix/altvm-file-submitter branch February 4, 2026 13:06
@github-project-automation github-project-automation bot moved this from In Review to Done in Hyperlane Tasks Feb 4, 2026
@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.02%. Comparing base (cf80e8f) to head (cfe1708).
⚠️ Report is 16 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7990   +/-   ##
=======================================
  Coverage   77.02%   77.02%           
=======================================
  Files         117      117           
  Lines        2651     2651           
  Branches      244      244           
=======================================
  Hits         2042     2042           
  Misses        593      593           
  Partials       16       16           
Components Coverage Δ
core 87.80% <ø> (ø)
hooks 71.86% <ø> (ø)
isms 81.10% <ø> (ø)
token 86.67% <ø> (ø)
middlewares 84.98% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants