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

Add statefulVerkleStateManager #3628

Merged
merged 44 commits into from
Sep 10, 2024
Merged
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
a847f86
scaffolding
acolytec3 Aug 28, 2024
107c883
broken WIP
acolytec3 Aug 28, 2024
78f1990
partial implementations
acolytec3 Aug 29, 2024
9cf5af7
fix getAccount
acolytec3 Aug 29, 2024
1419c9d
add todo
acolytec3 Aug 29, 2024
bb25fea
make trie.get accept suffixes
acolytec3 Aug 29, 2024
8c0605c
clean up reference
acolytec3 Aug 30, 2024
ef37d62
Add reserved bytes to encodeBasicData function
acolytec3 Aug 31, 2024
adad631
FIx encoding again
acolytec3 Sep 3, 2024
e69001c
spelling [no ci]
acolytec3 Sep 3, 2024
053fdea
change param to account [no ci]
acolytec3 Sep 3, 2024
762a694
Add support for basic account delete
acolytec3 Sep 3, 2024
293c86a
implement chunkify code
acolytec3 Sep 3, 2024
f6bbd1f
Add putCode
acolytec3 Sep 3, 2024
1d148ed
Move code to helpers
acolytec3 Sep 3, 2024
daa5faf
getCode and getCodeSize
acolytec3 Sep 4, 2024
036fa67
Start work on tests
acolytec3 Sep 4, 2024
d4e10dd
Update magic numbers to constants
acolytec3 Sep 4, 2024
e006237
Make get/putCode work
acolytec3 Sep 4, 2024
680ec51
Fix various get/putCode bugs
acolytec3 Sep 4, 2024
c7047fd
add get/putstorage
acolytec3 Sep 4, 2024
9161e02
export SFVKSM [no ci]
acolytec3 Sep 5, 2024
31fa232
Merge remote-tracking branch 'origin/master' into statefulVerkleState…
acolytec3 Sep 5, 2024
15e1d76
add commit/flush/revert
acolytec3 Sep 5, 2024
78ba172
Tests for caching
acolytec3 Sep 5, 2024
1f5e39f
make cspell happy
acolytec3 Sep 5, 2024
95b51e3
lint
acolytec3 Sep 5, 2024
04be4c6
add back missing method from interface
acolytec3 Sep 5, 2024
8b7d4b1
Merge remote-tracking branch 'origin/master' into statefulVerkleState…
acolytec3 Sep 6, 2024
3dc9346
Update packages/util/test/verkle.spec.ts
gabrocheleau Sep 8, 2024
f9d0825
Apply suggestions from code review
gabrocheleau Sep 8, 2024
1a8bd79
address some feedback
acolytec3 Sep 8, 2024
76316cb
Merge remote-tracking branch 'origin/master' into statefulVerkleState…
acolytec3 Sep 8, 2024
54c30c5
Update types and add test
acolytec3 Sep 6, 2024
f6e89ec
FIx commitment format
acolytec3 Sep 6, 2024
f4922c3
Update verkle crypto and add proof test
acolytec3 Sep 9, 2024
9f94d7d
add max chunks constant
acolytec3 Sep 9, 2024
36ac903
delete account in put if no account
acolytec3 Sep 9, 2024
6af9a3f
spelling
acolytec3 Sep 9, 2024
0133cc1
fix basic data encoding offsets
acolytec3 Sep 9, 2024
7c346df
remove console log
acolytec3 Sep 9, 2024
b97e813
Fix suffix logic
acolytec3 Sep 9, 2024
6a810fc
Merge remote-tracking branch 'origin/master' into statefulVerkleState…
acolytec3 Sep 10, 2024
48ba734
Apply feedback
acolytec3 Sep 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'origin/master' into statefulVerkleState…
…Manager
  • Loading branch information
acolytec3 committed Sep 6, 2024
commit 8b7d4b19abf1834d15759a559adeffc85c06a57c
10 changes: 10 additions & 0 deletions packages/util/src/verkle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,16 @@ export function decodeVerkleLeafBasicData(encodedBasicData: Uint8Array): VerkleL
return { version, nonce, codeSize, balance }
}

/**
* This function takes a `VerkleLeafBasicData` object and encodes its properties
* (version, nonce, code size, and balance) into a compact `Uint8Array` format. Each
* property is serialized and padded to match the required byte lengths defined by
* EIP-6800. Additionally, 3 bytes are reserved for future use as specified
* in EIP-6800.
* @param {VerkleLeafBasicData} basicData - An object containing the version, nonce,
* code size, and balance to be encoded.
* @returns {Uint8Array} - A compact, binary-encoded representation of the account header basic data.
*/
export function encodeVerkleLeafBasicData(account: Account): Uint8Array {
const encodedVersion = setLengthLeft(int32ToBytes(account.version), VERKLE_VERSION_BYTES_LENGTH)
// Per EIP-6800, bytes 1-4 are reserved for future use
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.