fix: preserve caller-owned UTXO DB connection#5573
Closed
iamdinhthuan wants to merge 1 commit into
Closed
Conversation
Contributor
|
Welcome to RustChain! Thanks for your first pull request. Before we review, please make sure:
Bounty tiers: Micro (1-10 RTC) | Standard (20-50) | Major (75-100) | Critical (100-150) A maintainer will review your PR soon. Thanks for contributing! |
Contributor
Author
|
Closing this duplicate in favor of #5572, which has the same caller-owned UTXO connection patch and is linked to bounty claim Scottcjn/rustchain-bounties#10623. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
UtxoDB.apply_transaction()from closing a caller-owned SQLite connection when rejecting an unauthorizedmining_rewardtransactionWhy
apply_transaction(..., conn=external_conn)accepts a caller-owned connection. The unauthorized publicmining_rewardguard returnedFalse, but closedexternal_connfirst, so callers could not inspect, roll back, or continue their transaction after a normal validation failure.Bounty route
iamdinhthuanTests
python3 -m pytest node/test_utxo_db.py::TestUtxoDB::test_user_supplied_mining_reward_preserves_external_conn -qfailed withsqlite3.ProgrammingError: Cannot operate on a closed databasepython3 -m pytest node/test_utxo_db.py::TestUtxoDB::test_user_supplied_mining_reward_preserves_external_conn node/test_utxo_db.py::TestUtxoDB::test_user_supplied_mining_reward_rejected_before_opening_db node/test_utxo_db.py -q->72 passedpython3 -m py_compile node/utxo_db.py node/test_utxo_db.pygit diff --checkDuplicate / safety check
caller-owned connection apply_transaction mining_rewardandpreserve caller owned UTXO connectionreturned no exact public duplicate immediately before push.