-
Notifications
You must be signed in to change notification settings - Fork 12.2k
Fix grammar errors in utilities documentation #5105
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
base: typo-fixes
Are you sure you want to change the base?
Fix grammar errors in utilities documentation #5105
Conversation
|
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.
Hey, thanks for your PR. Mostly looks good but I'd like to take the opportunity to update the reference to web3.js if you don't mind.
This commit updates the ECDSA documentation to reference the more current `ethers` and `viem` libraries for generating Ethereum account ECDSA signatures. Changes made: - Updated reference from `web3.eth.sign` to `signMessage` function in the ethers library and viem documentation. These changes provide more relevant and up-to-date information for developers using the ECDSA functions. I have ensured that the updated links point to the correct sections of the ethers and viem documentation. Co-authored-by: Ernesto García <[email protected]>
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.
Thanks!
The storage in the EVM is shaped in chunks of 32 bytes, each of these chunks is known as _slot_, and can hold multiple values together as long as these values don't exceed their size. These properties of the storage allow for a technique known as _packing_, that consists of placing values together on a single storage slot to reduce the costs associated to reading and writing to multiple slots instead of just one. | ||
|
||
Commonly, developers pack values using structs that place values together so they fit better in storage. However, this approach requires to load such struct from either calldata or memory. Although sometimes necessary, it may be useful to pack values in a single slot and treat it as a packed value without involving calldata or memory. | ||
Commonly, developers pack values using structs that place values together so they fit better in storage. However, this approach requires loading such a struct from either calldata or memory. Although sometimes necessary, it may be useful to pack values in a single slot and treat it as a packed value without involving calldata or memory. |
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.
Lets discuss the content here. Packing is done in storage. Memory and Calldata do not pack values.
What does it mean that packing "requires loading such a struct from either calldata or memory" ?
When you do packing, that is reading/writting to storage. This is a storage <> stack thing (sstore/sload). The packing is prepared on the stack.
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.
What does it mean that packing "requires loading such a struct from either calldata or memory" ?
It means that a struct:
struct Something {
bool a;
uint128 b;
}
Would require to allocate memory for manipulation as in:
// An argument
function foo(Something memory s) ...
// Part of a function
Something memory s = ...;
Your suggestion looks good imo
Co-authored-by: Hadrien Croubois <[email protected]>
Co-authored-by: Hadrien Croubois <[email protected]>
This pull request addresses several grammar errors in the documentation of utilities.
Changes made:
I have ensured the changes adhere to the engineering guidelines and all tests and linters have been run successfully.