Skip to content

Conversation

@crocodile-dentist
Copy link
Contributor

Description

Generalized mempool getWriter to validate tx's in a given context and returning user defined validation errors

Checklist

Quality

  • Commit sequence makes sense and have useful messages, see ref.
  • New tests are added and existing tests are updated.
  • Self-reviewed the PR.

Maintenance

  • Linked an issue or added the PR to the current sprint of ouroboros-network project.
  • Added labels.
  • Updated changelog files.
  • The documentation has been properly updated, see ref.

Copy link
Collaborator

@coot coot left a comment

Choose a reason for hiding this comment

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

LGTM, I would just remove the ctx from mempoolAddTxs, since this can be done outside of the mempoolAddTxs.

-- ^ return `True` when a failure should throw an exception
-- ^ acquire validation context
-> ( [tx]
-> ctx
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we remove the ctx, I realised at some point that we don't need inside it inside getWriter``: we acquire it in m ctx callback, which can be done outside of `getWriter` and passed to the validation callback. This will slightly simplify `getWriter`.

I should have cleaned this up before, so sorry for asking you to do that in this PR.

Comment on lines 205 to 206
writerAdapter MempoolWriter { txId, mempoolAddTxs } = undefined
TxSubmissionMempoolWriter { txId, mempoolAddTxs = adapter }
Copy link
Collaborator

@coot coot Dec 11, 2025

Choose a reason for hiding this comment

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

This is not finished or just not needed undefined.

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

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants