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

client: kaustinen7 verkle testnet preparation #3433

Merged
merged 18 commits into from
Sep 2, 2024

Conversation

gabrocheleau
Copy link
Contributor

@gabrocheleau gabrocheleau commented May 17, 2024

This PR makes the following updates to ready our client for Kaustinen stateless syncing:

  • Removes the stateRoot handling and caching for the previous block. The parent block's stateRoot will now be provided in the verkle execution witness directly, so we can retrieve it from it.
  • Updates the Verkle leaf structure. The version, nonce, balance and codeSize fields have been packed into a single BASIC_DATA field. See Update EIP-4762: reworked gas schedule from interop ethereum/EIPs#8550 for more details.
  • Update test data to Kaustinen7 test data
  • Test Kaustinen7 syncing

@gabrocheleau gabrocheleau marked this pull request as draft May 17, 2024 14:53
Copy link

codecov bot commented Jul 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (4470cc3) to head (1222967).
Report is 34 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (4470cc3) and HEAD (1222967). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (4470cc3) HEAD (1222967)
block 1 0
tx 1 0
Additional details and impacted files

Impacted file tree graph

Flag Coverage Δ
block ?
client 0.00% <ø> (ø)
tx ?
wallet 0.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Contributor

@g11tech g11tech left a comment

Choose a reason for hiding this comment

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

yes we look mostly uptodate, i have an open PR regarding system accounts that we needs to be finalized

Copy link
Contributor

@acolytec3 acolytec3 left a comment

Choose a reason for hiding this comment

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

Have updated this based on latest master and cleaned up the references to stateroot in verifyVerkleProof

@@ -520,13 +500,13 @@ export class StatelessVerkleStateManager implements StateManagerInterface {
* @param {Uint8Array} stateRoot - The stateRoot to verify the executionWitness against
* @returns {boolean} - Returns true if the executionWitness matches the provided stateRoot, otherwise false
*/
verifyVerkleProof(stateRoot: Uint8Array): boolean {
Copy link
Contributor

Choose a reason for hiding this comment

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

Renaming verifyVerkleProof on the StatelessVerkleStateManager to verifyProof would be more in line with the changes in #3557 and with other current implementations of statemanagers that we have.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This might be something that we'd want to extract to separate helpers, in line with what we've been doing with some other classes (extracting methods into standalone helpers)

Copy link
Contributor

Choose a reason for hiding this comment

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

Will open a new issue for this one since we can update it for both of the verkle SM implementations at once.

Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if one has already been created, but created #3629 for this.

@acolytec3 acolytec3 marked this pull request as ready for review September 2, 2024 01:59
@acolytec3
Copy link
Contributor

@gabrocheleau could we skip the failing tests for now and then continue work for the kaustinen7 changes (notably the fix I have for the encodeBasicData function) in the statefulVerkleStateManager branch?

@@ -215,3 +222,46 @@ export const getVerkleTreeKeyForStorageSlot = async (

return concatBytes(getVerkleStem(verkleCrypto, address, treeIndex), toBytes(subIndex))
}

export function decodeVerkleLeafBasicData(encodedBasicData: Uint8Array): VerkleLeafBasicData {
Copy link
Member

Choose a reason for hiding this comment

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

Just to note that we should at some point (best still before breaking releases even if not particularly about Verkle) give the Verkle docs a bit more love and e.g. complete and clean up the docs in this Util module (and e.g. give methods like decodeVerkleLeafBasicData() some code docs).

Also the Verkle README should giv a somewhat more complete picture on and introduction to the library.

Copy link
Contributor

Choose a reason for hiding this comment

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

I can give this a look and get some changes started.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got a basic description and example set up at #3630.

Copy link
Contributor

@acolytec3 acolytec3 left a comment

Choose a reason for hiding this comment

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

LGTM - will address kaustinen7 test data needs in a future PR

@acolytec3 acolytec3 merged commit b9a386c into master Sep 2, 2024
39 of 40 checks passed
@scorbajio scorbajio deleted the client/prepare-kaustinen-7 branch September 3, 2024 17:16
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.

5 participants