Running large commands via bitcoin-cli
(such as submitting a large tx or block) runs into the MAX_ARG_STRLEN
limit, which is 128KB on many systems. (see e.g. https://trofi.github.io/posts/299-maximum-argument-count-on-linux-and-in-gcc.html for more info).
This PR suggests to make it possible to bypass this limit by allowing to put the command and all of its args into a file. The functional test framework is then adjusted to automatically use this option (using a temporary file) if --usecli
is specified and there is an arg that is too large.
This might also be helpful for users outside of the functional tests (although there is always the option to use the rpc interface directly instead of bitcoin-cli
).
This is something many of our functional tests run into when executed with --usecli
on master: (OSError: [Errno 7] Argument list too long: 'bitcoin-cli'
)
The third commit enables several of them - there are a few more tests than those mentioned there, that could be enabled in a follow-up, but need some more adjustments beyond that.