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 tx verification #1654

Merged
merged 37 commits into from
Jun 27, 2023
Merged

Simplify tx verification #1654

merged 37 commits into from
Jun 27, 2023

Conversation

StephenButtolph
Copy link
Contributor

Why this should be merged

Removes various caching layers and dead code.

  • Errors loudly on RejectTx.
  • Removes caching of SyntacticVerification and moves it directly into ParseTx (before performing DB IO)
  • Removes caching of SemanticVerification - if this ever fails once the node will FATAL... and we only call it once if it passes.

How this works

delete moar code

How this was tested

CI

@StephenButtolph StephenButtolph added vm This involves virtual machines cleanup Code quality improvement labels Jun 26, 2023
@StephenButtolph StephenButtolph added this to the v1.10.4 milestone Jun 26, 2023
@StephenButtolph StephenButtolph self-assigned this Jun 26, 2023
Base automatically changed from simplify-unique-tx to dev June 26, 2023 16:11
@@ -23,9 +21,8 @@ var (
_ snowstorm.Tx = (*UniqueTx)(nil)
_ cache.Evictable[ids.ID] = (*UniqueTx)(nil)

errMissingUTXO = errors.New("missing utxo")
errUnknownTx = errors.New("transaction is unknown")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a non-issue now?

tx.Tx == nil no more?

Copy link
Contributor Author

@StephenButtolph StephenButtolph Jun 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tx.Tx can only be nil now from the UniqueTx construction in Dependencies. We don't actually use these txs in consensus anywhere (see followup to remove them: #1656) so this should be impossible to happen now (i.e. consensus only handles txs returned from ParseTx).

joshua-kim pushed a commit to dshiell/avalanchego that referenced this pull request Jun 26, 2023
@StephenButtolph StephenButtolph merged commit b5412ab into dev Jun 27, 2023
14 checks passed
@StephenButtolph StephenButtolph deleted the simplify-unique-tx-2-v2 branch June 27, 2023 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Code quality improvement vm This involves virtual machines
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants