-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Swap to ThreadPoolExecutor and use chia_rs version of validate_clvm_and_signature() #18213
base: main
Are you sure you want to change the base?
Conversation
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
da137fa
to
32547fb
Compare
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
e80e820
to
6f23c03
Compare
Conflicts have been resolved. A maintainer will review the pull request shortly. |
7ad3f4d
to
22969f4
Compare
@@ -507,7 +507,7 @@ async def test_duplicate_output() -> None: | |||
async def test_block_cost_exceeds_max() -> None: | |||
mempool_manager = await instantiate_mempool_manager(zero_calls_get_coin_records) | |||
conditions = [] | |||
for i in range(2400): | |||
for i in range(3800): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the main reason some numbers change in this test, as I understand it, is because we no longer turn transactions into "simple generators" before running them. This is more efficient and also more accurate now that (with the hard fork) we no longer pay cost for the generator ROM. So:
- transactions are cheaper on the chain since the hard fork
- the new logic reflects this cheaper reality
- the test therefore will fit more transactions in a block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm that doesn't seem to be correct.
With the inclusion of byte cost in Chia-Network/chia_rs#679 we now have a higher cost than what's currently in main, not lower.
This highlighted line for example goes down from needing 2400
items in main, to needing just 2389
(not 3800
), due to cost becoming higher, and the expected cost for https://github.com/Chia-Network/chia-blockchain/pull/18213/files#diff-6a5a9dba08be65c628eff46226c4f7d83c6dbf4bcb9c15649c228b9d8b244c76R581 as another example goes up from main's 10268283
to 19144088
, not down to 6600088
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the inclusion of byte cost in Chia-Network/chia_rs#679 we now have a higher cost than what's currently in main, not lower.
I suspect this is a bug in the rust implementation. Although, as it turns out, the true reason these numbers had to change (so much) is because of the current issue with the rust implementation (not including size cost)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sent a fix for that in Chia-Network/chia_rs#680 and adapted to the fix here with #18537.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I left some suggestions in addition to Arvid's points.
The core.full_node
group seems to have some failed tests as well.
@@ -268,7 +268,6 @@ async def farm_block( | |||
get_unspent_lineage_info_for_puzzle_hash=self.coin_store.get_unspent_lineage_info_for_puzzle_hash, | |||
item_inclusion_filter=item_inclusion_filter, | |||
) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be an unintentional diff.
chia/types/eligible_coin_spends.py
Outdated
# generator = simple_solution_generator(new_sb) | ||
assert mempool_item.conds is not None | ||
try: | ||
new_sbc_result = get_conditions_from_spendbundle( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would name this new_conditions
or new_conds
to fit their use below, better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
chia/types/eligible_coin_spends.py
Outdated
@@ -354,4 +354,4 @@ async def process_fast_forward_spends( | |||
# change. Still, it's good form to update the spend bundle with the | |||
# new coin spends | |||
mempool_item.spend_bundle = new_sb | |||
mempool_item.conds = new_npc_result.conds | |||
mempool_item.conds = new_sbc_result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With a name like new_conditions
or new_conds
this reads better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
c6407b9
to
73abaa5
Compare
@matt-o-how there's a problem with the rust implementation.
|
ccdbffa
to
19f6cd6
Compare
7835275
to
fb71e79
Compare
Co-authored-by: Amine Khaldi <[email protected]>
Co-authored-by: Amine Khaldi <[email protected]>
Co-authored-by: Amine Khaldi <[email protected]>
Co-authored-by: Amine Khaldi <[email protected]>
Co-authored-by: Amine Khaldi <[email protected]>
… overhead into account, creating blocks that exceed the max size.
fb71e79
to
c53d78b
Compare
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
This PR has been flagged as stale due to no activity for over 60 days. It will not be automatically closed, but it has been given a stale-pr label and should be manually reviewed by the relevant parties. |
Purpose:
Migrate to using the chia_rs version of validate_clvm_and_signature and use ThreadPools for faster concurrent execution.
Until chia-rs is bumped to include the pyfunctions
get_name_puzzle_conditions
andvalidate_clvm_and_signature
the tests for this will fail.Current Behavior:
We currently use the Python version of validate_clvm_and_signature which forces us to use ProcessPools
New Behavior:
Use the chia_rs version of validate_clvm_and_signature and use ThreadPools for faster concurrent execution.