-
Notifications
You must be signed in to change notification settings - Fork 141
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
move node types and handlings to separate packages #729
Open
ceyonur
wants to merge
8
commits into
move-atomic-sync
Choose a base branch
from
move-atomic-network-handlers
base: move-atomic-sync
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…reth into move-atomic-network-handlers
…reth into move-atomic-network-handlers
ceyonur
commented
Jan 6, 2025
return nil | ||
} | ||
|
||
func (vm *VM) RegisterLeafRequestHandler(nodeType message.NodeType, metricName string, trieDB *triedb.Database, trieKeyLen int, useSnapshot bool) error { |
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.
Hmm I wonder if we should register an interface rather than nodeType directly. I feel like there is definitely room to improve this PR in general, but did not want to break it anything further.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why this should be merged
Moves declaration of message.NodeType to separate pkgs
How this works
This pull request includes several changes to the
plugin/evm
package, primarily focusing on the atomic trie synchronization and request handling.Atomic Trie Synchronization:
plugin/evm/atomic/atomic_syncer.go
: IntroducedAtomicTrieNode
constant and replacedatomicKeyLength
withAtomicTrieKeyLength
throughout the file. [1] [2] [3] [4]Request Handling:
plugin/evm/message/handler.go
: Simplified theRequestHandler
interface by mergingHandleStateTrieLeafsRequest
andHandleAtomicTrieLeafsRequest
into a singleHandleLeafsRequest
method. [1] [2]plugin/evm/message/leafs_request.go
: UpdatedLeafsRequest
to use a singleNodeType
field and removed the distinction between state and atomic trie nodes. [1] [2]plugin/evm/vm.go
: IntroducedRegisterLeafRequestHandler
that can register differentmessage.NodeType
s and passes configs tonetworkHandler
to handle registered NodeTypes accordingly by creating leaf request handlers for each type.Test Updates:
plugin/evm/atomic/atomic_syncer_test.go
: Updated tests to useAtomicTrieKeyLength
instead ofatomicKeyLength
. [1] [2] [3] [4]plugin/evm/message/leafs_request_test.go
: Removed tests that validated the old node type-specific request handling.Additional Changes:
plugin/evm/atomic/atomic_trie.go
: ReplacedatomicKeyLength
withAtomicTrieKeyLength
. [1] [2]plugin/evm/atomic/atomic_trie_iterator.go
: Removed theatomicTrieKeyLen
constant and replaced its usage withAtomicTrieKeyLength
. [1] [2]These changes collectively simplify the codebase and improve the maintainability of the atomic trie synchronization and request handling logic.
How this was tested
Existing UTs
Need to be documented?
No
Need to update RELEASES.md?
No