Skip to content
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

Invert calling of MEMPOOL rule #4864

Open
lehins opened this issue Jan 31, 2025 · 0 comments
Open

Invert calling of MEMPOOL rule #4864

lehins opened this issue Jan 31, 2025 · 0 comments
Labels
💳 technical-debt Issues related to technical debt we introduced

Comments

@lehins
Copy link
Collaborator

lehins commented Jan 31, 2025

Current placement of MEMPOOL rule was a bit of a mistake.

It's goal originally was precautionary, ion case we run into issues we'd like to handle at the mempool level. That's why we tried to add it with the least amount of breakage to the downstream users. However, it is quickly turning into something a lot more useful. In fact current placement of the rule prevents us from taking care of #4849, because it does not allow short-circuiting.

The correct placement of the MEMPOOL rule should be above the LEDGER rule, while today LEDGER rule invokes the MEMPOOL rule. So, the invocation should be inverted.

Originally when I realized it, I fell into despair that we will not be able to do it without a hard fork, because we cannot break node-to-client protocol and changing predicate failures would lead to such breakage. In other words if we change the MempoolPredFailure to contain the LedgerPredFailure we will cause breakage to serialization and that would be unacceptable.

But then, I realized that we don't need to change the serialization in order to invert the invocation order. All we need to do is set the predicate failure for MEMPOOL rule to be:

  type PredicateFailure (ConwayMEMPOOL era) = ConwayLedgerPredFailure era

It is a bit of a hack, that will need to be fixed for the future era, but today we can safely take this approach

@lehins lehins added the 💳 technical-debt Issues related to technical debt we introduced label Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💳 technical-debt Issues related to technical debt we introduced
Projects
None yet
Development

No branches or pull requests

1 participant