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

UntypedBlock & UntypedTransaction #1978

Merged
merged 14 commits into from
May 25, 2022
Merged

Conversation

dahlia
Copy link
Contributor

@dahlia dahlia commented May 20, 2022

Closes #1974, and partially addresses #1164 (comment).

This introduces UntypedBlock and UntypedTransaction under a new project named Libplanet.Node.

@dahlia dahlia self-assigned this May 20, 2022
@dahlia dahlia force-pushed the untyped-block branch 2 times, most recently from 574a4e8 to c347e62 Compare May 24, 2022 08:37
@dahlia dahlia marked this pull request as ready for review May 24, 2022 08:41
@dahlia dahlia changed the title WIP: UntypedBlock & UntypedTransaction UntypedBlock & UntypedTransaction May 24, 2022
@dahlia dahlia force-pushed the untyped-block branch 2 times, most recently from a50a1a8 to f911fdb Compare May 24, 2022 09:51
Comment on lines +2 to +7
{
/// <summary>
/// Similar to <see cref="ITxMetadata"/> except that it has <see cref="TxId"/> as well.
/// Note that this does not contain actions or signature.
/// </summary>
public interface ITxExcerpt : ITxMetadata
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we clarify it's use a bit more?

As I understand it, seems like this is to "group" UntypedTransaction and Transaction<T> for validating nonces. In any case, the relation between ITxExcerpt and ITxMetadata should mirror that of IBlockExcerpt and IBlockMetadata if possible. 😕

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I defined the term excerpt as a set of metadata functioning as a proof without complete data (usually lacking its body like actions and transactions). That's why IBlockExcerpt has Hash, and ITxExcerpt has Id.

Copy link
Contributor

@greymistcube greymistcube May 25, 2022

Choose a reason for hiding this comment

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

I defined the term excerpt as a set of metadata

I see excerpts are some sort of metadata. On the other hand, ITxMetadata and IBlockMetadata have analogous specific uses. I'm still confused as to what this is "proving" really and if ITxExcerpt : ITxMetadata is necessary.

  • If the term excerpt is to extend metadata interfaces with additional proof data, than inheritance is granted.
  • If the term excerpt is to be used for naming an auxiliary interface with minimal amount of information than there shouldn't be an inheritance relation.

I'm suggesting that either we have IBlockExcerpt : IBlockMetadata and ITxExcerpt : ITxMetadata (this is the former of the above) or not have inheritance relations between them (the latter of the above). The split design seems confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, I see.

Copy link
Contributor

Choose a reason for hiding this comment

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

Not to pester, but is this being worked on? I'm done with skimming reviewing the code, but I wasn't sure about your last comment. 😶

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried to make ITxMetadata to inherit nothing, but it wasn't that easy as TxExcerptExtensions.ValidateTxNonces() used several properties of ITxMetadata. Instead, I'm going to rename its name later.

Copy link
Contributor

Choose a reason for hiding this comment

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

👌

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pull-request-quantifier-deprecated

This PR has 1290 quantified lines of changes. In general, a change size of upto 200 lines is ideal for the best PR experience!


Quantification details

Label      : Extra Large
Size       : +916 -374
Percentile : 100%

Total files changed: 35

Change summary by file extension:
.sh : +1 -0
.md : +33 -0
.json : +5 -0
.csproj : +144 -0
.cs : +733 -374
.sln : +0 -0

Change counts above are quantified counts, based on the PullRequestQuantifier customizations.

Why proper sizing of changes matters

Optimal pull request sizes drive a better predictable PR flow as they strike a
balance between between PR complexity and PR review overhead. PRs within the
optimal size (typical small, or medium sized PRs) mean:

  • Fast and predictable releases to production:
    • Optimal size changes are more likely to be reviewed faster with fewer
      iterations.
    • Similarity in low PR complexity drives similar review times.
  • Review quality is likely higher as complexity is lower:
    • Bugs are more likely to be detected.
    • Code inconsistencies are more likely to be detetcted.
  • Knowledge sharing is improved within the participants:
    • Small portions can be assimilated better.
  • Better engineering practices are exercised:
    • Solving big problems by dividing them in well contained, smaller problems.
    • Exercising separation of concerns within the code changes.

What can I do to optimize my changes

  • Use the PullRequestQuantifier to quantify your PR accurately
    • Create a context profile for your repo using the context generator
    • Exclude files that are not necessary to be reviewed or do not increase the review complexity. Example: Autogenerated code, docs, project IDE setting files, binaries, etc. Check out the Excluded section from your prquantifier.yaml context profile.
    • Understand your typical change complexity, drive towards the desired complexity by adjusting the label mapping in your prquantifier.yaml context profile.
    • Only use the labels that matter to you, see context specification to customize your prquantifier.yaml context profile.
  • Change your engineering behaviors
    • For PRs that fall outside of the desired spectrum, review the details and check if:
      • Your PR could be split in smaller, self-contained PRs instead
      • Your PR only solves one particular issue. (For example, don't refactor and code new features in the same PR).

How to interpret the change counts in git diff output

  • One line was added: +1 -0
  • One line was deleted: +0 -1
  • One line was modified: +1 -1 (git diff doesn't know about modified, it will
    interpret that line like one addition plus one deletion)
  • Change percentiles: Change characteristics (addition, deletion, modification)
    of this PR in relation to all other PRs within the repository.


Was this comment helpful? 👍  :ok_hand:  :thumbsdown: (Email)
Customize PullRequestQuantifier for this repository.

@greymistcube greymistcube self-requested a review May 25, 2022 09:37
@dahlia dahlia merged commit 37c7598 into planetarium:main May 25, 2022
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.

UntypedBlock & UntypedTransaction
2 participants