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

Consolidate and cleanup tx aggregation #1332

Merged
merged 6 commits into from Aug 13, 2018
Merged

Consolidate and cleanup tx aggregation #1332

merged 6 commits into from Aug 13, 2018

Conversation

ignopeverell
Copy link
Contributor

  • Include commitments non-duplicate checks in aggregate
  • Remove said check from the pool
  • Block building now uses tx aggregation to reduce duplication

Didn't want to get too deep in the rabbit hole but I think we're at a point where there's enough common validation code between Block and Transaction to introduce a thing that both would include. The thing could have the Vecs of Input, Output and Kernel and all the validation in common.

* Include commitments non-duplicate checks in aggregate
* Remove said check from the pool
* Block building now uses tx aggregation to reduce duplication
@ignopeverell
Copy link
Contributor Author

Created #1333 for the block and transaction validation cleanup.

Copy link
Member

@antiochp antiochp left a comment

Choose a reason for hiding this comment

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

Looks good.
Couple of comments.
A question about how we handle coinbase outputs during aggregation/cut-through.

@@ -431,14 +431,16 @@ impl Transaction {
/// Validates all relevant parts of a fully built transaction. Checks the
/// excess value against the signature as well as range proofs for each
/// output.
pub fn validate(&self) -> Result<(), Error> {
pub fn validate(&self, as_block: bool) -> Result<(), Error> {

This comment was marked as spam.

This comment was marked as spam.

if self.inputs.len() > consensus::MAX_BLOCK_INPUTS {
return Err(Error::TooManyInputs);
}
self.verify_features()?;
if !as_block {

This comment was marked as spam.

This comment was marked as spam.


let in_set = inputs
.iter()
.map(|inp| inp.commitment())
.collect::<HashSet<_>>();

let out_set = outputs
.iter()
.filter(|out| !out.features.contains(OutputFeatures::COINBASE_OUTPUT))

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@ignopeverell ignopeverell merged commit e9c987c into mimblewimble:master Aug 13, 2018
jackrack pushed a commit to jackrack/grin that referenced this pull request Aug 22, 2018
* Include commitments non-duplicate checks in aggregate
* Remove said check from the pool
* Block building now uses tx aggregation to reduce duplication
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants