Skip to content

Fix issue #2070. Don't fail context update when there is a - #2098

Open
LGLO wants to merge 1 commit into
mainfrom
fix-issue-2070
Open

Fix issue #2070. Don't fail context update when there is a#2098
LGLO wants to merge 1 commit into
mainfrom
fix-issue-2070

Conversation

@LGLO

@LGLO LGLO commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Overview

Fixed #2070 by not crashing replay when there is a send_mn_transaction record of a transaction that wasn't included in Midnight Ledger because it was not well formed.

🗹 TODO before merging

  • Ready

📌 Submission Checklist

  • All commits are signed off (git commit -s) for the DCO
  • Changes are backward-compatible (or flagged if breaking)
  • Pull request description explains why the change is needed
  • Self-reviewed the diff
  • I have included a change file, or skipped for this reason:
  • If the changes introduce a new feature, I have bumped the node minor version
  • Update documentation (if relevant)
  • Updated AGENTS.md if build commands, architecture, or workflows changed
  • No new todos introduced

🧪 Testing Evidence

Please describe any additional testing aside from CI:

  • Additional tests are provided (if possible)

🔱 Fork Strategy

  • Node Runtime Update
  • Node Client Update
  • Other:
  • N/A

Links

@LGLO
LGLO requested a review from a team as a code owner September 4, 2026 15:46
send_mn_transaction record of a transaction that wasn't included in Midnight Ledger.

Signed-off-by: Lech Głowiak <lech.glowiak@shielded.io>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 263d604ec6

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

"Failing result {err:?} of validating tx 0x{hash} \nto update Local Ledger State"
);
(new_ledger_state, offers, vec![], SyntheticCost::ZERO)
(tx_context.ref_state.clone(), vec![], vec![], SyntheticCost::ZERO)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep malformed locally generated transactions as errors

This fallback also applies to the public update_from_tx path, not only historical replay. The ledger-8 batch generator calls that method at util/toolkit/src/tx_generator/builder/builders/ledger_8/batches.rs:321-323 and 480-483, then unconditionally appends the transaction; if a generated transaction fails well_formed, this branch now returns Ok without updating state, so subsequent batches can reuse the same inputs and the command can emit an invalid transaction chain instead of failing. Restrict this tolerance to block replay, while preserving InvalidTransaction for local updates.

Useful? React with 👍 / 👎.

tx.erase_proofs().well_formed(ref_state, strictness, tblock)
};

match valid_tx {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Mirror the fallback in the ledger-9 replay path

The new handling exists only in the ledger-8 context, while LedgerVersion::from_spec_version routes every 2.0.0+ block to ledger 9 and apply_block_9 invokes the unchanged ledger_9::LedgerContext::update_from_block. Consequently, any failed send_mn_transaction whose ledger-9 well_formed check returns Err still aborts replay at ledger/helpers/src/ledger_9/context.rs:412-417, reproducing the same outage for current ledger-9 history. Apply the same replay-only fallback to the ledger-9 implementation.

Useful? React with 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

toolkit: cannot sync against Preview — replay aborts on a chain-accepted transaction

1 participant