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

run_block_generator() #122

Merged
merged 1 commit into from
Jan 13, 2023
Merged

run_block_generator() #122

merged 1 commit into from
Jan 13, 2023

Conversation

arvidn
Copy link
Contributor

@arvidn arvidn commented Jan 12, 2023

Add a higher level function to run block generators. This includes the generator ROM program. Raising the abstraction level allows the function to return the full cost of the generator (including the byte-cost). Previously, we could only return the CLVM and conditions cost.

This patch is a step towards porting the generator ROM to rust, which would have these advantages:

  1. We could run blocks with a lower memory footprint by resetting the allocator in between each puzzle
  2. We could record the CLVM cost per puzzle (which helps with identical spend deduplication, which needs to track cost per spend)
  3. We could fail invalid blocks faster, bu parsing and partially validating the conditions after each puzzle. i.e. we wouldn't need to run all puzzles first, and then parse and validate their output.

richardkiss
richardkiss previously approved these changes Jan 12, 2023
Copy link
Contributor

@richardkiss richardkiss left a comment

Choose a reason for hiding this comment

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

I did make some comments, but I'll leave it up to you as to if you feel like implementing any of them.

@arvidn arvidn merged commit 750bc38 into main Jan 13, 2023
@arvidn arvidn deleted the generator-rom branch January 13, 2023 21:16
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