Skip to content

transactioner #19854

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

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

transactioner #19854

wants to merge 8 commits into from

Conversation

altendky
Copy link
Contributor

Purpose:

Current Behavior:

New Behavior:

Testing Notes:

@altendky altendky added Changed Required label for PR that categorizes merge commit message as "Changed" for changelog Exclude_Notes Use this label if the changes in the PR should be excluded from the release notes labels Jul 21, 2025
Copy link
Contributor

File Coverage Missing Lines
chia/util/sqlite_wrapper.py 80.4% lines 59-60, 68, 98, 181-182, 184-189, 191, 193, 200-201, 207, 209
chia/util/transactioner.py 90.3% lines 22, 61, 72-75, 83, 91, 93-94, 103, 154, 216-220, 222-223
Total Missing Coverage
652 lines 37 lines 94%

Copy link
Contributor

@Quexington Quexington left a comment

Choose a reason for hiding this comment

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

Just some comments from a shallow review


def generate_in_memory_db_uri() -> str:
# We need to use shared cache as our DB wrapper uses different types of connections
return f"file:db_{secrets.token_hex(16)}?mode=memory&cache=shared"
Copy link
Contributor

Choose a reason for hiding this comment

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

Any particular reason for indeterminism here rather than passing in a nonce and deferring to the client?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

secrets...? that's odd. but i think this is just used for testing and simulator. was just copy/pasted in this pr. could well be better as you suggest.



@dataclass
class SqliteConnection:
Copy link
Contributor

Choose a reason for hiding this comment

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

I understand you don't like inheritance, but isn't there tangible benefit to not having to do all of the self._connection.whatever() pass through that could miss an endpoint in the future or create surface area for bugs in pass-through?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

counter point is that i explicitly have had interest in having a wrapper layer independent of this change. i forget what else, but i at least considered banning certain sqlite queries etc. i think there were other uses... maybe...

row_factory: Optional[type[aiosqlite.Row]] = None,
) -> AsyncIterator[DBWrapper2]:
db_uri = generate_in_memory_db_uri()
async with sqlite_wrapper.managed(
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know how feasible it is, but it would be cool to have an example of a minimal backend that is not sqlite in this test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

having common testing against the various implemented backends is one of the major things that is missing so far. vaguely, i expect to have common tests and each backend must implement test-specific activities like 'write to a value' and 'read that value' or somesuch. just whatever the common tests require to run.

@github-actions github-actions bot added the merge_conflict Branch has conflicts that prevent merge to main label Aug 11, 2025
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 coverage-diff Exclude_Notes Use this label if the changes in the PR should be excluded from the release notes merge_conflict Branch has conflicts that prevent merge to main
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants