-
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
New RPC block_spends - Get spends for block using transaction generator #10446
New RPC block_spends - Get spends for block using transaction generator #10446
Conversation
This pull request introduces 1 alert when merging d0460c6cd09f1515fc6d3eeca4d3cf81e114fe41 into bf4a632 - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging c69f96f into bf4a632 - view on LGTM.com new alerts:
|
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.
Thank you for making this PR! How is the performance?
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.
LGTM thanks for the PR!
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 think there are some opportunities for simplifications. I'm also not convinced the test covers an interesting case (just by looking at it)
chia/rpc/full_node_rpc_api.py
Outdated
flags = 0 | ||
|
||
args = create_generator_args(block_generator.generator_refs).first() | ||
_, block_result = block_generator.program.run_with_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.
program
is a SerializedProgram
, right?
Getting the generator arguments right here is non trivial. Are you confident the test covers this properly?
would like to get this in, please see Qs. thanks freddy! |
This pull request introduces 2 alerts when merging ae579aa into 773d692 - view on LGTM.com new alerts:
|
This pull request introduces 2 alerts when merging 5e857ff into 773d692 - view on LGTM.com new alerts:
|
… fc.get_block_spends
This pull request introduces 2 alerts when merging 58baa04 into 773d692 - view on LGTM.com new alerts:
|
This pull request introduces 2 alerts when merging 0c32c227c163c0caa5a835d622a4fd2609e5ca33 into 773d692 - view on LGTM.com new alerts:
|
This pull request introduces 2 alerts when merging ac72f8e1fbba94806b61712bf02480f928fd0016 into 9db85f3 - view on LGTM.com new alerts:
|
This pull request introduces 2 alerts when merging 4a2909a into 9db85f3 - view on LGTM.com new alerts:
|
1 similar comment
This pull request introduces 2 alerts when merging 4a2909a into 9db85f3 - view on LGTM.com new alerts:
|
… fc.get_block_spends
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. |
… fc.get_block_spends
This pull request introduces 1 alert when merging b7b4f7e into 0e41982 - view on LGTM.com new alerts:
|
Currently think the test fails due to how the tests simulate farming blocks and how block_generator defaults to None here https://github.com/Chia-Network/chia-blockchain/blob/main/tests/block_tools.py#L1892 |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
…or (#12062) * New RPC block_spends - Get spends for block using transaction generator (#10446) * get spends for block using transaction generator * type annotations and use existing function * return None on exception * parse to CoinSpend * specify return type of get_block_spends in rpc client * see what can be asserted * test fix * flags not necessary as we don't validate * simplifying as cost is not required as we are not validating * improve test to cover transaction generator ref_list * simplify test * remove unused import * slight change and cleanup * lint cleanup * clean up * wait until transaction is in mempool * fix lint Co-authored-by: Jack Nelson <jack@jacknelson.xyz> * fix lint Correct type and run lint checker * switch to custom clvm * add new puzzle * curry and make better * forgot to set linter to tools dir * undo run_block changes * Revert "curry and make better" The tests do not like it * correct tests Co-authored-by: Jack Nelson <jack@jacknelson.xyz>
Currently if you want to get all the spends for a block you have two options:
get_additions_and_removals
RPC followed by potentially thousands of calls toget_puzzle_and_solution
(one for each removal)get_block
endpoint and run the transaction generator. This is a bit better but can be slow depending on the environment in which your CLVM implementation is running.By adding this RPC we can benefit from the speed of the Rust CLVM implementation and it also means less code for anybody who needs this data.