-
Notifications
You must be signed in to change notification settings - Fork 46
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
Expand the TransactionVerifier
trait
#185
Comments
A sketch of a possible design is (pseudo code): #[async_trait]
pub trait TransactionPool: Send + Sync + 'static {
async fn tx_added(&self, tx: SharedProvenTx) -> Result<(), VerifyTxError>;
async fn batch_created(&self, tx: Vec<SharedProvenTx>) -> Result<(), VerifyTxError>;
async fn block_commited(&self, tx: Block) -> Result<(), VerifyTxError>;
} We may want the above as a trait because of #23, so we can implement an in-memory and DB implementations (although we sqlite we can have an in-memory DB, so that is not super necessary, and we could have a plain implementation instead). The design above makes sense to me since the lifecycle of the transaction changes after it touches multiple components. Which is kinda of modeled in the example above. |
A proposed flow is at #191 (comment) |
Rendered obsolete as the mempool now handles inflight tracking. |
miden-node/block-producer/src/txqueue/mod.rs
Lines 53 to 59 in 1462d45
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:
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 text was updated successfully, but these errors were encountered: