-
Notifications
You must be signed in to change notification settings - Fork 154
feat(all): dynamic state sync #870
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: master
Are you sure you want to change the base?
Conversation
… multiple times during verify/accept/reject
…ath-db. Now depends on libevm branch of same name
…ialization, fixed gentrie error
…g, attempt to clean shared memory
…erface used by x/sync. Both are managed by the dynamic syncer
…schemes in syncer
peer/network.go
Outdated
var req message.Request | ||
if _, err := n.codec.Unmarshal(request, &req); err != nil { | ||
log.Debug("forwarding AppRequest to SDK network", "nodeID", nodeID, "requestID", requestID, "requestLen", len(request), "err", err) |
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.
note once the new state sync algo is in place, the legacy handler can be removed and all peer requests can directly be forwarded to the "SDK" handler.
plugin/evm/block.go
Outdated
vdbBatch, err := b.vm.versiondb.CommitBatch() | ||
func (b *Block) acceptAtomicOps() error { | ||
vm := b.vm | ||
_, lastHeight, err := vm.readLastAccepted() |
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.
nit: I think you could get this like: vm.LastAcceptedBlock().Height()
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, this is the one tracked by the engine?
This PR denotes rebased commits from two other PRs (#771 and #830) to the new clean
libevm
history. The first PR denotes changes to geth'ssnap
protocol to enable usage in our repo, since a there were a few differences (the comment describes it). The second PR is the final step in which there was a successful state sync on Fuji prior to Fortuna upgrade.There's a few things that I should mention that are mostly related to structure.
snap_manager.go
logic is very similar to that of thedownloader.go
in geth. TheSnapSync()
method essentiallyprocessSnapSyncContent
. I removed a lot of the (seemingly) excessive logic here, but it could still be simpler - specifically thestateSync
channeling. There's also technically some race conditions involving the channelling insnapManager
on interruption, but I'm pretty sure it will always exit gracefully with helpful error messages.stateSyncerclient
toDynamicSyncer
is necessary because we need to block from queueing blocks once we finish the state sync, and then once the queue is cleared, we release the lock, allowing blocks to be verified as normal.DynamicSyncer
was designed to use the minimalmanager
interface, which is exactly what is used byx/sync
, but with a small type change for convenience right now (x/sync
usesids.ID
for the root). The goal was to completely separate the eth-syncing logic from theDynamicSyncer
, which focuses on the queuing and block operation logic.libevm
repo - the branch has the same name. This is the majority of seemingly unrelated changes with theStackTrie
. Without PathDB, this should be unnecessary