-
Notifications
You must be signed in to change notification settings - Fork 44
Fix issue #2070. Don't fail context update when there is a record of rejected transaction #2098
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+92
−18
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
changes/toolkit/changed/fix-replay-abort-on-well-formed-failure.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| #toolkit #bugfix | ||
| # Don't abort context replay on a `well_formed` failure the chain itself tolerated | ||
|
|
||
| `LedgerContext::apply_txs_collect_events` (in both the ledger-8 and ledger-9 | ||
| implementations, behind `update_from_block`) aborted the whole block replay | ||
| whenever a transaction's `well_formed` check returned `Err`, e.g. | ||
| `OutOfDustValidityWindow` for a dust action whose `ctime` lands a couple of | ||
| seconds past the including block's `tblock`. This made every toolkit workflow | ||
| that replays a context (transaction generation, wallet inspection, faucets, | ||
| test-data generators) unusable against a chain — such as Preview — carrying a | ||
| transaction the chain itself had accepted: on-chain, | ||
| `pallet_midnight::send_mn_transaction` hits this same check via | ||
| `LedgerApi::apply_transaction`, but only fails that one extrinsic's dispatch | ||
| (storage rolled back, `ExtrinsicFailed` emitted) without affecting block | ||
| validity, so a `well_formed` failure alone is not evidence of an invalid block. | ||
|
|
||
| `apply_txs_collect_events` now matches on `LedgerContextError::InvalidTransaction` | ||
| specifically and, on that variant, logs a warning and moves on to the next | ||
| transaction instead of propagating the error and aborting the replay. Every | ||
| other error variant still aborts. `update_from_tx` (used by the `batches` | ||
| generator to validate each transaction it builds before chaining more on top | ||
| of it) is untouched and keeps hard-failing: a generator needs to know | ||
| immediately if its own just-built transaction is doomed, since tolerating it | ||
| there would let a doomed transaction ship in the output batch and further | ||
| batches get built against funds it never actually created. | ||
|
|
||
| PR: https://github.com/midnightntwrk/midnight-node/pull/2098 | ||
| Issue: https://github.com/midnightntwrk/midnight-node/issues/2070 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.