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

CHIA-1763: Make functions use bls cache immutably #793

Merged
merged 2 commits into from
Nov 15, 2024
Merged

Conversation

Rigidity
Copy link
Contributor

@Rigidity Rigidity commented Nov 15, 2024

BLSCache has all its members protected by a mutex. In order to allow threads sharing the same object, it needs to be treated as immutable. This is the patter Mutex is meant to be used in.

It's believed to address the issue from pyo3:

full_node chia.full_node.full_node: ERROR    Error in _handle_one_transaction, closing: Traceback (most recent call last):
  File "/home/arvid/dev/chia-blockchain/chia/full_node/full_node.py", line 475, in _handle_one_transaction
    inc_status, err = await self.add_transaction(entry.transaction, entry.spend_name, peer, entry.test)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/arvid/dev/chia-blockchain/chia/full_node/full_node.py", line 2681, in add_transaction
    cost_result = await self.mempool_manager.pre_validate_spendbundle(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/arvid/dev/chia-blockchain/chia/full_node/mempool_manager.py", line 298, in pre_validate_spendbundle
    bls_cache.update(new_cache_entries)
RuntimeError: Already borrowed

@Rigidity Rigidity changed the title Immutable bls cache Make functions use bls cache immutably Nov 15, 2024
@Rigidity Rigidity requested a review from arvidn November 15, 2024 00:06
@Rigidity Rigidity changed the title Make functions use bls cache immutably CHIA-1763: Make functions use bls cache immutably Nov 15, 2024
Copy link

Pull Request Test Coverage Report for Build 11847643372

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 17 of 17 (100.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 83.825%

Totals Coverage Status
Change from base Build 11841415899: 0.0%
Covered Lines: 12847
Relevant Lines: 15326

💛 - Coveralls

@arvidn arvidn merged commit 2d6f511 into main Nov 15, 2024
52 checks passed
@arvidn arvidn deleted the immutable-bls-cache branch November 15, 2024 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants