Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd, core, eth: journal local transactions to disk #14784
This PR adds a disk journal to the transaction pool to back up local transactions. Upon startup, the contents of the journal are merged into the transaction pool, each transaction (and inherently sender address) marked as local. After that on startup, and every hour (configurable via cli) the current contents of the transaction pool are written out into a replacement journal and moved in place of the old one.
During the hour between the journal regeneration, the current journal is kept open append-only, and any arriving local transaction is injected into it.
Code looks OK, but I can imagine this breaking if many transactions are sent. Another thing to think about is how we could make this feature work with the light client.
Maybe the journal could be moved to its own object so it can send transactions into any pool, not just core.TxPool.
I can look into the light pool in a followup PR. In all honesty I'd rather just use this pool, but if that's not possible, I can make any adjustments needed to get the journal in there too.