Skip to content
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

Simplify batch pre validate blocks #18602

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

arvidn
Copy link
Contributor

@arvidn arvidn commented Sep 18, 2024

This PR is best reviewed one commit at a time.

Purpose:

We currently use NPCResults in many places where the error cannot be set. This PR is a small step towards using the (inner) SpendBundleConditions directly in those cases.

Specifically, it makes batch_pre_validate_blocks() take a dict of SpendBundleConditions instead of NPCResults.
It also introduces an early exit in case get_name_puzzle_conditions() returns a failure.

The PreValidationResults still contains an NPCResult, as it's a bit more work to make it use SpendBundleConditions directly. Although, it could; the error is not allowed to be set.

Current Behavior:

batch_pre_validate_blocks() takes a dict of uint32 -> NPCResult.

New Behavior:

batch_pre_validate_blocks() takes a dict of uint32 -> SpendBundleConditions.

@arvidn arvidn added the Changed Required label for PR that categorizes merge commit message as "Changed" for changelog label Sep 18, 2024
@arvidn arvidn force-pushed the simplify-batch_pre_validate_blocks branch from 4e40404 to 456c4d5 Compare September 18, 2024 11:39
@arvidn arvidn marked this pull request as ready for review September 18, 2024 12:13
@arvidn arvidn requested a review from a team as a code owner September 18, 2024 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changed Required label for PR that categorizes merge commit message as "Changed" for changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants