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

[WIP] v3 blocks and transactions (no redundant input features) #3385

Closed
wants to merge 19 commits into from

Conversation

antiochp
Copy link
Member

@antiochp antiochp commented Jul 10, 2020

[WIP]

  • v2 inputs are FeaturesAndCommit
  • v3 inputs are CommitOnly

There is some complexity here as translating a v3 input to v2 requires "external" data (the output features). The output features must be read from the output MMR which must be in the correct state itself, based on current block being processed.

Additionally this messes with sort order as we sort based on hash and the data being hashed is different.
So converting v2->v3 and v3->v2 cannot be done purely on individual inputs.
It must be handled at the collection level as the collection of inputs must be reordered to account for the new sort order.

Resolves #3378.


TODO -

  • Inputs enum variants CommitOnly, FeaturesAndCommit
  • CommitWrapper for sorting commitments correctly by hash()
  • serialization support for Input variants (v2 vs. v3)
  • block support
    • receive v2
    • receive v3
    • broadcast/send v2
    • broadcast/send v3
    • convert v2 -> v3
    • convert v3 -> v2
    • store in db in v2 (for backward compatibility)
  • transaction support
    • convert v2 -> v3
    • handle as v3 internally in txpool
    • convert to v2 for backward compatibility for v2 peers
    • relay/send v2
    • relay/send v3
  • version negotiation (make sure this is working as expected)

@antiochp antiochp self-assigned this Jul 11, 2020
@antiochp antiochp force-pushed the input_commitments branch 3 times, most recently from e3e1a45 to 891ecb4 Compare July 24, 2020 09:24
@antiochp antiochp changed the title [WIP] Inputs commit only, no output features [WIP] v3 blocks and transactions (no redundant input features) Jul 24, 2020
@antiochp
Copy link
Member Author

antiochp commented Aug 8, 2020

Replaced with smaller more focused refactor PRs (various) and #3419.

@antiochp antiochp closed this Aug 8, 2020
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.

Transaction (and block) inputs need only include the commitment
1 participant