Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR refactors block header field validation out of vm.runBlock into a new validateHeaderFields helper, with the intended behavior change of collecting and reporting all header mismatches instead of failing fast on the first mismatch.
Changes:
- Added
validateHeaderFields.tsto perform header validation and aggregate mismatches into a single error. - Updated
runBlockto callvalidateHeaderFieldsduring non-generated-field execution to centralize validation logic.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/vm/src/validateHeaderFields.ts | Introduces the new header validation helper and aggregated error reporting. |
| packages/vm/src/runBlock.ts | Replaces inline header validation with a call to validateHeaderFields. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📦 Bundle Size Analysis
Values are minified+gzipped bundles of each package entry. Workspace deps are bundled; external deps are excluded. Generated by bundle-size workflow |
|
Can you give a quick reasoning why you are doing this? |
2 main reasons:
|
This PR externalizes the header field validation conditionals from
vm.runBlockinto a new fuction:validateHeaderFieldsexported fromvalidateHeaderFields.ts.Also modifies the error reporting to include all mismatches. Previously
runBlockwould fail at the first header field mismatch. Often this meant ainvalid receiptsRooterror thrown, when in reality, multiple header fields were probably mismatched.The new function will check all of the header fields, and report the full list of mismatched fields.