bss: split up SubmitBatchTx method in Driver iface#2008
bss: split up SubmitBatchTx method in Driver iface#2008mslipper merged 3 commits intoethereum-optimism:developfrom
Conversation
|
Codecov Report
@@ Coverage Diff @@
## develop #2008 +/- ##
========================================
Coverage 74.58% 74.58%
========================================
Files 79 79
Lines 2554 2554
Branches 401 401
========================================
Hits 1905 1905
Misses 649 649
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
a96bc0b to
ae414aa
Compare
ae414aa to
a051271
Compare
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.
Previously it was being logged every time we modified the gas price. Additionally, we log the raw byte length rather than tx.Size(). The latter returns a float value of type StorageSize, which explains why the metrics haven't been indicating actual byte values.
a051271 to
961dfe2
Compare
Description
The current
Driverinterface supports only one method for both crafting andpublishing a batch transaction,
SubmitBatchTx. Currently this is beingexecuted on each new gas price that the
txmgrcommands, implying we aredoing 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 PR remedies all of the above issues by splitting out the
transaction crafting process from the publication. A new method,
CraftBatchTx, is added to theDriverinterface. This method isresponsible for creating a fully formed transaction, but does not
publish it. The responsibility of
SubmitBatchTxis now modified to takean predefined transaction, i.e. created by
CraftBatchTx, overwrite thesupplied gas price, and publish. In this way, this expensive call to
build batches can be done once before handing the transaction of the
txmgr.Additionally, we now log the raw byte length for the
batch_tx_sizemetricrather than tx.Size(). The latter returns a float value of type
StorageSize,which explains why the metrics haven't been indicating the actual byte values.
These commits are carried over from prior work done on #1993.
Builds on
Metadata