-
Notifications
You must be signed in to change notification settings - Fork 8
added remove code leaf builin func name #267
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
base: feat/remove-code-leaf
Are you sure you want to change the base?
Conversation
| } | ||
|
|
||
| // KeyValueHolder is used to hold a key and an associated value | ||
| type KeyValueHolder interface { |
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.
can we target the branch towards a feat branch?
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.
done
|
|
||
| // WithoutCodeLeaf is used for account with code, it specifies that the trie code leaf has been moved to storage, | ||
| // it is enabled only after the activation of MigrateCodeLeafEnableEpoch flag | ||
| WithoutCodeLeaf |
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.
all nodes with version "without code leaf" are assumed to be also with auto balance enabled right?
Just to confirm, it would not be possible to move from NotSpecified directly to WithoutCodeLeaf right?
If this is the case we should take care of the testing process to allow enough time (and actively do the first migration - auto balance) before this and ensure everything is migrated to auto balance before, or directly start with AutoBalanceEnabled active.
Also would this version change affect the logic for auto balancing since the version will be different but auto balancing will still need to be done? (I am asking here if there are checks in the code for the specific AutoBalanceEnabled version)
The base branch was changed.
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.
Pull Request Overview
This PR adds support for migrating code leaves in trie nodes by introducing a new trie node version called "WithoutCodeLeaf". The implementation includes versioning support for key-value storage and adds a new built-in function for code leaf migration.
- Introduces
WithoutCodeLeaftrie node version with corresponding flag handling - Updates
KeyValueHolderinterface andkeyValStorageimplementation to include version information - Adds
BuiltInFunctionMigrateCodeLeafconstant for the new migration functionality
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| core/trie.go | Adds WithoutCodeLeaf version enum, string representation, and validation logic |
| core/keyValStorage/keyValStorage.go | Updates keyValStorage struct and constructor to include version field |
| core/keyValStorage/keyValStorage_test.go | Updates test to use new constructor signature with version parameter |
| core/interface.go | Adds Version() method to KeyValueHolder interface |
| core/constants.go | Adds BuiltInFunctionMigrateCodeLeaf constant |
| // BuiltInFunctionMigrateDataTrie is the built-in function key for migrating the data trie | ||
| const BuiltInFunctionMigrateDataTrie = "MigrateDataTrie" | ||
|
|
||
| // BuiltInFunctionMigrateCodeLeaf is the built-in function key for migrating code leaf |
Copilot
AI
Jul 23, 2025
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.
The PR title contains a spelling error: 'builin' should be 'builtin' (missing 't'). While this doesn't affect the code, it should be corrected for clarity.
| // BuiltInFunctionMigrateCodeLeaf is the built-in function key for migrating code leaf | |
| // BuiltInFunctionMigrateCodeLeaf is the builtin function key for migrating code leaf |
No description provided.