Skip to content

Conversation

luke-jr
Copy link
Member

@luke-jr luke-jr commented Aug 24, 2020

We raise blocks to BLOCK_VALID_SCRIPTS regardless of whether we validate scripts or skip them.

A more obvious change might be to demote scripts-skipped to BLOCK_VALID_CHAIN and allow this status as an ancestor of BLOCK_VALID_SCRIPTS, but that would have compatibility issues at least.

Instead, just begin setting an additional flag set when we don't skip script checks.

This could be useful for later going back and verifying scripts of skipped blocks post-sync, but it's not clear to me yet if that's useful with assumeutxo around the corner(?). Regardless, it seems like a good idea to save this detail in case it proves useful.

@luke-jr
Copy link
Member Author

luke-jr commented Aug 24, 2020

Hmm, one shortcoming of this approach, is that it doesn't differentiate between "verified with ruleset X" from "verified with ruleset Y" as would occur when you upgrade for a softfork after activation.

This is still better than nothing at all, but I wonder if we should add logic for the latter? Perhaps just a "ruleset version" in the db, which we can check and clear the flag on blocks appropriately?

@sdaftuar
Copy link
Member

sdaftuar commented Jan 6, 2021

This is still better than nothing at all, but I wonder if we should add logic for the latter? Perhaps just a "ruleset version" in the db, which we can check and clear the flag on blocks appropriately?

I think I'm a concept ACK on adding something to track which validation rules were applied when validating each block, so that after softfork activation we could efficiently revalidate the blocks that weren't validated with all the rules. I haven't given a lot of thought to how much work it is to do this though.

@DrahtBot
Copy link
Contributor

DrahtBot commented Jul 24, 2021

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #22564 ([WIP] refactor: Move mutable globals cleared in ::UnloadBlockIndex to BlockManager by dongcarl)
  • #21526 (validation: UpdateTip/CheckBlockIndex assumeutxo support by jamesob)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@DrahtBot
Copy link
Contributor

🐙 This pull request conflicts with the target branch and needs rebase.

Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft".

@luke-jr
Copy link
Member Author

luke-jr commented Dec 19, 2021

Think this is better off being redone softfork-aware somehow. Closing for now.

@luke-jr luke-jr closed this Dec 19, 2021
@bitcoin bitcoin locked and limited conversation to collaborators Dec 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants