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

move trie key utils methods from besu to besu-verkle-trie #80

Merged
merged 3 commits into from
Jan 23, 2025

Conversation

matkt
Copy link
Contributor

@matkt matkt commented Jan 22, 2025

PR description

Another small cleaning by moving methods from Besu to Besu-verkle-trie

Fixed Issue(s)

Copy link

  • I thought about the changelog.

return Bytes32.wrap(CODE_OFFSET.add(UInt256.fromBytes(chunkId)).divide(VERKLE_NODE_WIDTH));
}

public static List<Bytes32> getCodeChunkTrieKeyIndexes(final Bytes code) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: getCodeChunkKeyTrieIndexes ?
To be consistent with other methods.

Or drop the Trie altogether from the methods because it's irrelevant since they are already inside a class called TrieKeyUtils

Copy link
Contributor Author

Choose a reason for hiding this comment

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

modifed the name and used getCodeChunkKeyTrieIndexes

}
}

public static List<Bytes32> getStorageKeyTrieIndexes(final List<Bytes32> storageSlotKeys) {
Copy link
Contributor

@lu-pinto lu-pinto Jan 23, 2025

Choose a reason for hiding this comment

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

in Besu there was an Optional check to get the actual slotKey (Bytes32) out of a SlotStorageKeyobject, but I guess you'll handle that in Besu?

From Besu:

  public List<Bytes32> generateStorageKeyIds(final Set<StorageSlotKey> storageSlotKeys) {
    return storageSlotKeys.stream()
        .map(
// -->            storageSlotKey -> 
//  -->              trieKeyAdapter.getStorageKeyTrieIndex(storageSlotKey.getSlotKey().orElseThrow()))
        .map(Bytes32::wrap)
        .toList();
  } 

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes I will handle that in besu

Copy link
Contributor

@lu-pinto lu-pinto left a comment

Choose a reason for hiding this comment

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

LG

@matkt matkt merged commit a5cac6c into hyperledger:main Jan 23, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants