Skip to content

Mempool policy: EIP-27 re-emission prefilter (reopen of #2447 against v6.0.6) - #2475

Open
odiseusme wants to merge 6 commits into
ergoplatform:v6.0.6from
odiseusme:fix/reemission-mempool-prefilter
Open

Mempool policy: EIP-27 re-emission prefilter (reopen of #2447 against v6.0.6)#2475
odiseusme wants to merge 6 commits into
ergoplatform:v6.0.6from
odiseusme:fix/reemission-mempool-prefilter

Conversation

@odiseusme

Copy link
Copy Markdown

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.

…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.
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.

1 participant