Skip to content

feat: loadtest calldata file#934

Open
jhkimqd wants to merge 3 commits into
mainfrom
feat/loadtest-calldata-file
Open

feat: loadtest calldata file#934
jhkimqd wants to merge 3 commits into
mainfrom
feat/loadtest-calldata-file

Conversation

@jhkimqd

@jhkimqd jhkimqd commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Description

  • Current polycli loadtest implementation only supports --calldata flag. When we're attempting to stress test large calldata, this becomes an issue because the size is capped.
  • This PR introduces a --calldata-file flag 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.

jhkimqd added 3 commits June 9, 2026 12:45
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.
@jhkimqd jhkimqd requested a review from a team June 9, 2026 03:48
@jhkimqd jhkimqd enabled auto-merge June 9, 2026 03:48
@sonarqubecloud

sonarqubecloud Bot commented Jun 9, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant