-
Notifications
You must be signed in to change notification settings - Fork 66
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 EIP7736 support #457
base: master
Are you sure you want to change the base?
Add EIP7736 support #457
Changes from 19 commits
39fdd6c
32ce419
25ba7b9
ec74e56
3f23ce0
de94975
d536897
342e683
5419a7d
d037673
4f15b6c
3d0659a
d59b620
cc43672
861826a
e558f36
ae9ac46
9e5c6fa
f631e65
ed32767
d68c4ae
84e62fb
2bb9b2e
1a73d65
64151cb
b670596
36036fb
1ce49aa
c42a5c2
971c099
4cee9df
fe3e25c
dd87e7f
2950a74
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
weiihann marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package verkle | ||
|
||
import ( | ||
"encoding/binary" | ||
) | ||
|
||
type StatePeriod uint16 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I already asked that, but why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note that if this is because we don't want to take too much space with the leaf encoding, we can always store it as a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As per our convo, this is a premature optimization and this comment should be discarded. We can look into it in the future. |
||
|
||
const ( | ||
NumActiveEpochs = 2 | ||
) | ||
|
||
func IsExpired(prev StatePeriod, cur StatePeriod) bool { | ||
weiihann marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return cur >= prev+NumActiveEpochs // TODO(weiihann): deal with overflow | ||
} | ||
|
||
func StatePeriodFromBytes(b []byte) StatePeriod { | ||
return StatePeriod(binary.BigEndian.Uint16(b)) | ||
} |
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.
it would be nice to have another benchmark that checks how much time it takes to expire the data. For example, a benchmark that inserts a few "old" leaves in the tree, then a lot more "newer" leaves, and then see how much it takes to delete all leaves.
We are not looking into bulk-expiring the tree, I think it would be insane, but to estimate what it would take to expire a few leaves per block, in case we detect that they are still present in the tree in case they are expired. Think of a "garbage collect on access" type of approach.