feat: loadtest calldata file#934
Open
jhkimqd wants to merge 3 commits into
Open
Conversation
The inline --calldata flag carries hex calldata on argv, so it is bounded by
the OS single-argument limit (MAX_ARG_STRLEN, ~128 KiB on Linux) — capping
contract-call payloads at roughly 64 KB of calldata. Sending near-TxMaxSize
(~130 KB) calldata is therefore impossible via --calldata ("Argument list too
long").
Add --calldata-file, which reads the same hex encoding from a file. The path is
resolved in Config.Validate() (before any tx is sent): it is mutually exclusive
with --calldata, strips all whitespace so line-wrapped hex dumps (xxd/od) work,
rejects empty/"0x"-only input, and validates the hex up front. The resolved
value is written back into ContractCallData, so the contract-call execution path
is unchanged. Update the --contract-address/usage help and the runner guard to
mention the new flag.
Table of config tests for resolveContractCallData: file read with trailing newline, interior-whitespace stripping (wrapped hex), CRLF, 0x prefix, a 130 KB payload that exceeds the argv limit, mutual exclusivity with --calldata, empty and "0x"-only files, missing file, invalid hex, and end-to-end via Validate().
Regenerated via 'make gen-doc' to add the --calldata-file flag entry and the updated contract-call usage text.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
polycli loadtestimplementation only supports--calldataflag. When we're attempting to stress test large calldata, this becomes an issue because the size is capped.--calldata-fileflag which may contain much larger calldata to stress test a network with the above constraint removed by pointing to a file and reading from it.