Skip to content

Conversation

a1111198
Copy link

@a1111198 a1111198 commented Jul 5, 2024

This pull request addresses several grammar errors in the documentation of utilities.

Changes made:

  • "himself owner of" to "they are the owner of"
  • "an piece" to "a piece"
  • "however other signature algorithms" to "however, other signature algorithms"
  • "These are often generated via" to "These are often generated through"
  • "in that they use a different" to "in that they use different"
  • "these values don't exceed its size" to "these values don't exceed their size"
  • "each of this chunks" to "each of these chunks"
  • "However, this approach requires to load such struct" to "However, this approach requires loading such a struct"
  • "These properties of the storage allows for a technique known as" to "These properties of the storage allow for a technique known as"

I have ensured the changes adhere to the engineering guidelines and all tests and linters have been run successfully.

Copy link

changeset-bot bot commented Jul 5, 2024

⚠️ No Changeset found

Latest commit: 2363c50

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Member

@ernestognw ernestognw left a 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.

a1111198 and others added 2 commits July 15, 2024 17:35
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]>
ernestognw
ernestognw previously approved these changes Jul 16, 2024
Copy link
Member

@ernestognw ernestognw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

ernestognw
ernestognw previously approved these changes Jul 16, 2024
@ernestognw ernestognw changed the title Fix grammar errors in documentation Fix grammar errors in utilities documentation Jul 16, 2024
@ernestognw ernestognw requested a review from Amxx August 30, 2024 03:16
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.
Copy link
Collaborator

@Amxx Amxx Aug 30, 2024

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.

Copy link
Member

@ernestognw ernestognw Aug 25, 2025

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

@ernestognw ernestognw requested a review from a team as a code owner August 25, 2025 20:29
@ernestognw ernestognw changed the base branch from master to typo-fixes August 25, 2025 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants