-
Notifications
You must be signed in to change notification settings - Fork 810
Add SetPreferenceWithContext #4410
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?
Add SetPreferenceWithContext #4410
Conversation
Testing locally this seems to correctly be verifying warp messages in the mempool against the p-chain height of the next block's epoch. |
Co-authored-by: Michael Kaplan <[email protected]>
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.
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.
Why this should be merged
Fixes #4409
How this works
SetPreferenceWithContext
.How this was tested
Need to be documented in RELEASES.md?
No