Add seed file for importing mempool before taking snapshot#131
Add seed file for importing mempool before taking snapshot#131brunoerg wants to merge 2 commits intodergoegge:masterfrom
Conversation
da9e1de to
f18b5b1
Compare
f18b5b1 to
e8d93dd
Compare
| scenario initialization the seed file's bytes are written as `mempool.dat` and | ||
| imported into the node, then the snapshot is taken with that mempool state so | ||
| every test case executes against a node that starts with pre-populated | ||
| transactions. |
There was a problem hiding this comment.
Do you think it's helpful to explain here how the mempool.dat is created? I guess you need to mine the same number of blocks on a regtest node, create transactions, and then dump the file? Thinking about it more, the blocks need to be identical to what fuzzamoto creates?
There was a problem hiding this comment.
I wonder if it'd be better to allow an IR testcase as seedfile that is then executed before the snapshot. That seems a little more generic, and would enable other states as well.
There was a problem hiding this comment.
We were trying to figure out what RPCs to call to build the context and if in-mempool txns should be included in the context. I think we'd need dumptxoutset for the build_txos call and getrawmempool + getmempoolentry if mempool txns are included? Then we'd also need the block headers, though that seems straightforward.
There was a problem hiding this comment.
I wonder if it'd be better to allow an IR testcase as seedfile that is then executed before the snapshot. That seems a little more generic, and would enable other states as well.
This would be good, but the current approach is much simpler for now. But yes, the idea is having something like that as well, we just need to figure out what is necessary as @Crypt-iQ mentioned.
|
Leaving a note that the updated BIP153 code is linked here and it uses new message types now. |
This PR adds a new flag called
--seedfilewhich is used to pass a seed file that its raw bytes will be used to create amempool.datfile that will be imported before taking the snapshot. The main motivation of this feature is to test the BIP153 (Send template) which requires a populated mempool to be able to create the templates.As previously discussed with @Crypt-iQ, this PR implements a simple way of doing it, it only imports the mempool but doesn't update any context which is enough for testing BIP153. However, I intend to implement in a follow-up another flag that would be used to import a serialized version of
Programwhich would require update the context.