Skip to content

Conversation

michaelkaplan13
Copy link
Contributor

@michaelkaplan13 michaelkaplan13 commented Oct 9, 2025

Why this should be merged

Fixes #4409

How this works

  • Passes the P-Chain height to be used for verification of a child of the preferred block in SetPreferenceWithContext.
  • Uses the preferred context when verifying P-Chain txs before the enter the mempool.

How this was tested

  • Manual local tests
  • Unit tests

Need to be documented in RELEASES.md?

No

@StephenButtolph
Copy link
Contributor

Testing locally this seems to correctly be verifying warp messages in the mempool against the p-chain height of the next block's epoch.

@StephenButtolph StephenButtolph marked this pull request as ready for review October 18, 2025 16:24
@StephenButtolph StephenButtolph self-requested a review as a code owner October 18, 2025 16:24
@Copilot Copilot AI review requested due to automatic review settings October 18, 2025 16:24
Copy link
Contributor

@Copilot 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 implements the SetPreferenceWithContext interface to pass P-Chain height context when setting block preferences. This allows the P-Chain height to be used for verification of child blocks in the mempool.

  • Adds SetPreferenceWithContext interface implementation across multiple VM layers (tracedvm, metervm, proposervm, platformvm)
  • Updates platformvm to use preferred block's P-Chain height context for transaction verification before mempool entry
  • Adds comprehensive test coverage for the new functionality in both pre-fork and post-fork scenarios

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
vms/tracedvm/set_preference_with_context_vm.go New file implementing SetPreferenceWithContext with OpenTelemetry tracing
vms/tracedvm/block_vm.go Adds SetPreferenceWithContext interface support and tracing tags
vms/proposervm/vm_test.go Adds comprehensive test coverage for SetPreference functionality with context
vms/proposervm/vm.go Implements logic to call SetPreferenceWithContext with next epoch's P-Chain height
vms/platformvm/vm.go Implements SetPreferenceWithContext interface in platform VM
vms/platformvm/block/executor/manager.go Updates manager to use preferred context's P-Chain height for transaction verification
vms/metervm/set_preference_with_context_vm.go New file adding metrics collection for SetPreferenceWithContext
vms/metervm/block_vm.go Adds SetPreferenceWithContext interface support with metrics
snow/engine/snowman/block/block_context_vm.go Defines the SetPreferenceWithContext interface
vms/platformvm/block/executor/executormock/manager.go Updates mock to support new SetPreference signature

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: In Progress 🏗️

Development

Successfully merging this pull request may close these issues.

PlatformVM mempool verification should use child epoch height post-Granite activation

2 participants