Skip to content

Port the code-fetch Queue and wire the syncer producer #5643

Description

@powerslider

Goal

Complete the code-sync migration by porting the durable code-fetch Queue to the new p2p/proto stack and wiring it to its producer, so outstanding code requests survive restarts and the syncer's to-fetch marker handling has a real writer.

Problem

PR #5402 moved the code Syncer (consumer) into vms/evm/sync/code on the new p2p/proto client, but deferred graft/evm/sync/code/queue.go:

  • The Queue is the producer-side bridge: leaf-sync workers call AddCode, which persists customrawdb to-fetch markers and forwards hashes to the syncer's channel. Its only producer is leaf-sync, which lands on the leaf branch (Add leaf-range request handler #5405), so it had no caller in feat(vms/evm/sync/code): add code-by-hash request handler #5402.
  • As a result, nothing currently writes to-fetch markers. The Syncer's DeleteCodeToFetch calls (slow path and fulfill) are inert no-ops until the Queue lands, and there is no crash-recovery of outstanding code requests (init / recoverUnfetchedCodeHashes).
  • graft/evm/sync/code is still live (imported by graft/evm/sync/evmstate and graft/evm/sync/engine), so it cannot be deleted until the migration completes.

Proposed Solution

  1. Port queue.go into vms/evm/sync/code, adapting to the new tree. customrawdb already lives there. Drop or port a minimal replacement for graft/evm/sync/types.Finalizer.
  2. Wire the leaf-sync workers to call Queue.AddCode, and pass Queue.CodeHashes() into code.NewSyncer, replacing the direct channel the feat(vms/evm/sync/code): add code-by-hash request handler #5402 integration test feeds.
  3. Re-add Name() / ID() and a types.Syncer interface once a sync registry consumes them (dropped in feat(vms/evm/sync/code): add code-by-hash request handler #5402 to avoid an orphan types package).

Metadata

Metadata

Assignees

Type

Fields

No fields configured for Task.

Projects

Status
No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions