Skip to content

Improve ntx builder start up #1573

@Mirko-von-Leipzig

Description

@Mirko-von-Leipzig

#1568 fixed issue #1566 with a hacky solution (1 in the issue). Ideally we would do (2) instead.

The network transaction builder's start-up is currently done inline with the main event loop. It would be good to refactor this to more clearly distinguish between initialization and running. Configuration is also an issue e.g. the new function currently takes in a lot of Url but its unclear at the caller side which is meant for which.

I'm thinking an API to enable something like:

NetworkTransactionBuilder {
    store_url,
    block_producer_url,
    validator_url,
    tx_prover_url,
    script_cache_size,
}
// 1. Subscribe
// 2. Buffer mempool events and wait for 1st block
// 3. Fetch that block chain info from store
// 4. Create type that can be .run
.initialize().await?
// Main event loop
.run().await?

Metadata

Metadata

Labels

network transactionsRelates to the network transactions feature

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions