Repository navigation
Conversation
Use MintingBatch.Copy to avoid copying atomic state, cover staging isolation and error paths, and wrap wallet-anchor lines to satisfy CI lint. Co-authored-by: Sadiq Jaffer <SadiqJaf@users.noreply.github.com>
|
@macroscope-app review this PR |
|
Manual reviews triggered for commit All prior checks · these links stay valid even if you push more commits. |
|
Review started; results will be posted as check runs. |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR adds a substantial caller-defined anchor and external-signing workflow across minting, wallet leases, persistence, publication recovery, and public RPC/CLI interfaces. Its broad runtime side effects, combined with an unresolved high-severity risk that preparation may commit without producing the requested PSBT file, require human review. Not approved because:
Enable approvability here. Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more. |
assets mint fund ignored --no_change_output, --pre_commit_output_index, and the other custom-anchor output indexes when --anchor_psbt was omitted, then sent a normal wallet funding request. Reject that combination in the CLI before the RPC call. Co-authored-by: Sadiq Jaffer <SadiqJaf@users.noreply.github.com>
|
@macroscope-app review this PR |
|
Review started; results will be posted as check runs. |
assets mint fund treated a zero-length --anchor_psbt file as wallet funding because os.ReadFile succeeds and FundBatch selects custom mode only when anchor_psbt is non-empty. Reject that file before the RPC call. Co-authored-by: Sadiq Jaffer <SadiqJaf@users.noreply.github.com>
assets mint finalize treated a zero-length --signed_psbt file as wallet finalization because os.ReadFile succeeds and FinalizeBatch selects the externally signed anchor only when signed_psbt is non-empty. Reject that file before the RPC call. Co-authored-by: Sadiq Jaffer <SadiqJaf@users.noreply.github.com>
|
@macroscope-app review this PR |
|
Review started; results will be posted as check runs. |
assets mint prepare called PrepareBatch before writing --output_psbt. An unwritable path left the custom batch committed and returned an error without printing the response. Check that the path can be written first, and print the response whenever PrepareBatch succeeds. fund, seal, and finalize do not write an output file after their RPCs. Proof export, ownership proofs, backup export, and macaroon baking write after calls that can be repeated, so they are unchanged. Co-authored-by: Sadiq Jaffer <SadiqJaf@users.noreply.github.com>
|
@macroscope-app review this PR |
|
Review started; results will be posted as check runs. |
assets mint fund and finalize read --anchor_psbt and --signed_psbt with os.ReadFile, so a huge file or a device such as /dev/zero is allocated before the server's 4 MiB check. Open the file, reject non-regular files, and stop at that same limit. assets mint prepare used os.WriteFile for --output_psbt, which truncates an existing file before the packet is fully written. Write a temp file in the destination directory, sync and close it, then rename it over the target. Co-authored-by: Sadiq Jaffer <SadiqJaf@users.noreply.github.com>
|
@macroscope-app review this PR |
|
Review started; results will be posted as check runs. |
--anchor_psbt alone sent ChangeOutputIndex 0 because the Int64 flag defaults to 0. That collides with the default asset anchor output and customGenesisPsbt rejects the batch. Copy the index only when the flag is set, and otherwise mark the request as having no change output so the server stores -1. An explicit 0 still selects output 0. Co-authored-by: Sadiq Jaffer <SadiqJaf@users.noreply.github.com>
TestPrepareBatchPreservesOutputOnWriteError re-execs with RLIMIT_FSIZE. Under go test -cover the child still has that limit when the coverage runtime writes its meta file, which fails with "file too large". Drop GOCOVERDIR from the child and restore the soft limit before the test returns. Co-authored-by: Sadiq Jaffer <SadiqJaf@users.noreply.github.com>
|
@macroscope-app review this PR |
|
Review started; results will be posted as check runs. |
|
|
||
| case err == nil: | ||
| var f *os.File | ||
| f, err = os.OpenFile(path, os.O_WRONLY, 0) |
There was a problem hiding this comment.
🟠 High commands/assets.go:739
An existing writable --output_psbt can still make PrepareBatch commit successfully while the requested PSBT is never produced: writePreparedBatchPsbt needs to create and rename a sibling temporary file, but this branch only opens the target file. It also opens existing FIFOs, which can block indefinitely and cannot be written by the later rename. Probe create/rename access in the parent directory and reject existing non-regular paths before calling PrepareBatch.
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @cmd/commands/assets.go around line 739:
An existing writable `--output_psbt` can still make `PrepareBatch` commit successfully while the requested PSBT is never produced: `writePreparedBatchPsbt` needs to create and rename a sibling temporary file, but this branch only opens the target file. It also opens existing FIFOs, which can block indefinitely and cannot be written by the later rename. Probe create/rename access in the parent directory and reject existing non-regular paths before calling `PrepareBatch`.
|
@macroscope-app review this PR |
|
Review started; results will be posted as check runs. |
Rebase of lightninglabs#2238 onto current upstream main (85679bf). Tree matches lightninglabs#2238 head ed563e0 merged with main. Fork PR for Macroscope, Security Reviewer and CI before any upstream PR. Not for upstream until approved.