Mempool policy: EIP-27 re-emission prefilter (reopen of #2447 against v6.0.6) - #2475
Open
odiseusme wants to merge 6 commits into
Open
Mempool policy: EIP-27 re-emission prefilter (reopen of #2447 against v6.0.6)#2475odiseusme wants to merge 6 commits into
odiseusme wants to merge 6 commits into
Conversation
…pends still validate ErgoNodeViewHolder's Declined branch discarded the pool returned by ErgoMemPool.process, so the prefilter's rejected-id cache never reached a running node. Install the returned pool when it differs by reference, which is a no-op for every pre-existing declining path. Also: single-pass input resolution at the prefilter anchor, a clearer rejection message, and an end-to-end case covering a conformant owner spend with checkReemissionRules enabled.
Invariant (h) drives the token-preserving rejection through a real ErgoNodeViewHolder, using a test-only subclass whose InjectState message reuses the existing protected updateNodeView to install a synthetic token-bearing state. It asserts the id is cached both in the published ChangedMempool reader and in a freshly queried GetDataFromCurrentView. A companion control pins the reference-inequality guard as a no-op on a declining path that returns the same pool. Removing only the guarded install makes (h) fail while the control still passes.
Send InjectState and the transaction through the same probe to avoid an Akka per-pair FIFO race that could let the tx overtake the state injection onto the missing-UTXO path. Assert the intended decline reason in both cases, and assert minimalFeeAmount == 0 as an explicit precondition, since the fee gate precedes the prefilter. Behaviour unchanged; all four mutation checks (predicate-false, delete-install, unconditional-install, d3 burn) confirmed against these tests.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Reopening #2447 against v6.0.6 as requested (the original could not be reopened after rebase). Same six commits, rebased onto upstream/v6.0.6 with no conflicts.
Mempool policy: reject token-preserving re-emission spends before script execution (EIP-27 prefilter), plus installing the declined-path mempool when it changes, with ErgoMemPoolReemissionPrefilterSpec pinning invariants a-g and the installed-pool invariant via a node-view-holder actor case.
Tests run after rebase: ErgoMemPoolReemissionPrefilterSpec and ErgoNodeViewHolderSpec, 104 succeeded, 0 failed. Full history and review discussion in #2447.