Skip to content

Expand the TransactionVerifier trait #185

@hackaugusto

Description

@hackaugusto

https://github.com/0xPolygonMiden/miden-node/blob/1462d45aacd052295b0dffa568387b96c8cdc456/block-producer/src/txqueue/mod.rs#L53-L59

Implementations of the above trait are responsible to validate transactions, this has to account for transactions is the store, as well as transactions currently in flight. Namely, when two transactions try to consume the same nullifier, only one can succeed.

The issue with the above traits are the following:

  • The trait doesn't expose the complete API necessary to track in-flight transactions. This needs to be done with another trait, currently ApplyBlock, to callback this object and signal that an in-flight transaction has been committed to store, allowing the object to clean its internal state. While this works, it makes it harder to follow the code, since the interface is not "self sufficient".
  • The trait doesn't have an intermediary state, between this transaction has been added to the queue, to this transaction has been added to a batch. It would be interesting to model such a state, because once fees are implemented, we would like to prioritize transactions not by arrival order, but by amount of fees paid.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions