-
Notifications
You must be signed in to change notification settings - Fork 124
[hebao] Optimized memory copies #1714
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
Conversation
| returns (bytes memory) | ||
| { | ||
| return Wallet(wallet).transact(uint8(1), to, value, data); | ||
| bytes memory callData = abi.encodeWithSelector( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we also use fastCallAndVerify in transactDelegateCall and transactStaticCall>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or should we change memory to calldata as in transactDelegateCall without the function's body change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sometimes transactCall is used with a calldata data from the caller; sometimes the data is assembled in memory.
|
If the saving of gas is only ~0.5%-1.0%, we probably want to skip it :) |
I agree. We can keep the changes to |
Great, let's do that. |
|
Removed use of the new calls in the smart wallet, but left the functions in the library because they are actually useful in other scenario's. |
Optimized most frequent paths. In normal cases this only saves ~0.5%-1.0% of gas. Calls with a lot of data will save more gas, but probably quite infrequent.
I do feel like the compiler should be able to do this so we don't have to worry about this. Maybe I'll make an issue on the solidity github.