Skip to content

Conversation

@pcaversaccio
Copy link
Owner

@pcaversaccio pcaversaccio commented May 29, 2025

🕓 Changelog

This PR fixes the Argument list too long errors (see, e.g., here) by piping the (potentially very) large inputs to cast keccak and cast hash-message via stdin instead of passing it as a command-line argument. Please note that this PR relies on the patch for cast hash-message introduced in foundry-rs/foundry#10671, included in Foundry 1.2.2 and available in the latest stable release of cast.

Test Example

./safe_hashes.sh --network zksync --address 0x9fb5F754f5222449F98b904a34494cB21AADFdf8 --nonce 12

Select 1 for "Please enter the index of the array:".

returns:

===================================
= Selected Network Configurations =
===================================

Network: zksync
Chain ID: 324

========================================
= Transaction Data and Computed Hashes =
========================================

> Transaction Data:
Multisig address: 0x9fb5F754f5222449F98b904a34494cB21AADFdf8
To: 0xCC926359DBE6b6311D63f8155fcC3B57F3fAAE80
Value: 0
Data: 0x... (very large; omitted here)
Operation: Call
Safe Transaction Gas: 0
Base Gas: 0
Gas Price: 0
Gas Token: 0x0000000000000000000000000000000000000000
Refund Receiver: 0x0000000000000000000000000000000000000000
Nonce: 12
Encoded message: 0xbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d8000000000000000000000000cc926359dbe6b6311d63f8155fcc3b57f3faae800000000000000000000000000000000000000000000000000000000000000000390de467d7c8f2ce53221c9e9b8961d6f95a9bac95c8d64860569536e2530d7f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c
Method: Unknown
Parameters: Unknown

> Hashes:
Domain hash: 0x44B7F5D3633D89B36226C7C3FE506E64904143C6289D42E5EAE52EAB28D1B034
Message hash: 0x5FF90C7690C66DE45D4D84AE5BE2F7D4722E6236DBEB223B9450F7FC28ADA78D
Safe transaction hash: 0x8bf43f38a201cef8317d773de616d0dc75115c84d83fad4388f691cc00acd538

Now compare with https://app.safe.global/transactions/tx?safe=zksync:0x9fb5F754f5222449F98b904a34494cB21AADFdf8&id=multisig_0x9fb5F754f5222449F98b904a34494cB21AADFdf8_0x8bf43f38a201cef8317d773de616d0dc75115c84d83fad4388f691cc00acd538.

This PR also adds https://etherscan.io to the awesome_bot whitelist in the CI pipeline checks.yml.

Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
@pcaversaccio pcaversaccio added the documentation 📖 Improvements or additions to documentation label May 30, 2025
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
@pcaversaccio pcaversaccio added the refactor/cleanup ♻️ Code refactorings and cleanups label Jun 2, 2025
@pcaversaccio pcaversaccio changed the title 🐛 Use stdin to Hash Large Data Inputs ♻️ Use stdin to Hash Large Data Inputs Jun 2, 2025
@pcaversaccio pcaversaccio removed the bug 🐛 Something isn't working label Jun 2, 2025
@pcaversaccio pcaversaccio merged commit 12cd0bc into main Jun 2, 2025
14 of 18 checks passed
@pcaversaccio pcaversaccio deleted the fix/large-data-size branch June 2, 2025 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation 📖 Improvements or additions to documentation refactor/cleanup ♻️ Code refactorings and cleanups

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants