Skip to content

Conversation

@ssd04
Copy link
Contributor

@ssd04 ssd04 commented Oct 11, 2023

No description provided.

@ssd04 ssd04 self-assigned this Oct 11, 2023
@ssd04 ssd04 marked this pull request as ready for review October 12, 2023 07:56
}

// KeyValueHolder is used to hold a key and an associated value
type KeyValueHolder interface {
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

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)

@ssd04 ssd04 changed the base branch from rc/v1.7.0 to feat/remove-code-leaf December 13, 2023 14:30
@ssd04 ssd04 dismissed BeniaminDrasovean’s stale review December 13, 2023 14:30

The base branch was changed.

AdoAdoAdo
AdoAdoAdo previously approved these changes Dec 15, 2023
Copy link
Contributor

Copilot AI left a 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 WithoutCodeLeaf trie node version with corresponding flag handling
  • Updates KeyValueHolder interface and keyValStorage implementation to include version information
  • Adds BuiltInFunctionMigrateCodeLeaf constant 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
Copy link

Copilot AI Jul 23, 2025

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.

Suggested change
// BuiltInFunctionMigrateCodeLeaf is the built-in function key for migrating code leaf
// BuiltInFunctionMigrateCodeLeaf is the builtin function key for migrating code leaf

Copilot uses AI. Check for mistakes.
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.

4 participants