vdf: refactor aggregates ABI#252
Closed
dbentley-vsql wants to merge 1 commit into
Closed
Conversation
Member
|
I really feel like they are different enough that users should have a different factory function: make_aggregate_function(), rather than having to read down the list of functions being called. |
| std::string func_name(func_desc->name); | ||
|
|
||
| // clear/accumulate fields were added in PROTOCOL_2; older extensions | ||
| // Aggregate fields were added in PROTOCOL_2; older extensions |
Member
There was a problem hiding this comment.
Aggregate functions, not fields, right?
| bool has_accumulate_row = (func_desc->accumulate_row != nullptr); | ||
| bool has_read_accumulator = (func_desc->read_accumulator != nullptr); | ||
| if (has_clear || has_accumulate_row || has_read_accumulator) { | ||
| if (!has_clear || !has_accumulate_row || !has_read_accumulator) { |
Member
There was a problem hiding this comment.
Move this to the validation function, please. And add a unittest.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Refactor VDF ABI.
Scalar VDFs have 3 functions: prerun, vdf, postrun. (yes, the name vdf is un{descriptive,helpful}; sorry)
Aggregate VDFs have 5 functions. prerun and postrun and 3 that somewhat correspond to vdf. Logically, those 3 are:
This change changes them to have those names to reduce ambiguity.