Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow avoiding passing large arguments through program args #5069

Open
2 tasks done
Tracked by #8794
CodeSandwich opened this issue May 29, 2023 · 0 comments
Open
2 tasks done
Tracked by #8794

Allow avoiding passing large arguments through program args #5069

CodeSandwich opened this issue May 29, 2023 · 0 comments
Labels
A-compatibility Area: compatibility C-cast Command: cast T-feature Type: feature

Comments

@CodeSandwich
Copy link
Contributor

Component

Forge, Cast

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (50756e5 2023-05-29T00:04:27.574210907Z)

What command(s) is the bug in?

No response

Operating System

Linux

Describe the bug

Many commands require passing data of arbitrary size as program args:

  • cast abi-encode
  • cast access-list
  • cast call
  • cast calldata
  • cast disassemble
  • cast estimate
  • cast pretty-calldata
  • cast publish
  • cast rpc
  • cast send
  • cast wallet sign
  • forge create
  • forge script

Usually these are Solidity function arguments, but sometimes these are raw transaction payloads or RPC JSONs. The problem is that Linux (other OS-es probably too) puts a hard limit on the size of the program args, throwing Argument list too long if violated. For regular kernel builds it's just 128KB per arg, which for hex-encoded data halves the limit to just 64KB, it's very easy to hit it and there's no workaround.

There are a few approaches for passing arbitrarily-sized args without limitations:

  • Stdin. Convenient to use, has no size limitations, but it'd put a hard limit of a single arbitrarily-sized arg per command, e.g. it may be tricky to support the interactive wallet.
  • Files. Not very convenient to use, has no size limitations, wouldn't collide with any parameters.
  • Enviroment variables. Rather convenient to use, but does have some OS-dependent limitations, wouldn't collide with any parameters.

Any of these solutions would need to work along the regular passing by args to keep the backward compatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compatibility Area: compatibility C-cast Command: cast T-feature Type: feature
Projects
Archived in project
Development

No branches or pull requests

4 participants