• Conner Fromknecht's avatar
    feat: add more granular CraftBatchTx method to Driver iface · b64628ec
    Conner Fromknecht authored
    The current interface supports only one method for both crafting and
    publishing a batch transaction, SubmitBatchTx. Currently this is being
    executed on each new gas price that the txmgr commands, implying we are
    doing a lot of extra work to rederive batches. In addition, much our
    instrumentation lives inside this method, meaning that the they are also
    being recorded multiple times per transaction. When we get to
    processing larger batches on Kovan and Mainnet, this could also become a
    resource bottleneck.
    
    This commit remedies all of the above issues by splitting out the
    transaction crafting process from the publication. A new method,
    CraftBatchTx, is added to the Driver interface. This method is
    responsible for creating a fully formed transaction, but does not
    publish it. The responsibility of SubmitBatchTx is now modified to take
    an predefined transaction, i.e. created by CraftBatchTx, overwrite the
    supplied gas price, and publish. In this way, this expensive call to
    build batches can be done once before handing the transaction of the
    txmgr.
    b64628ec
driver.go 6.17 KB