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

Version transaction message and add new message format #18725

Merged
merged 9 commits into from
Aug 10, 2021

Conversation

jstarry
Copy link
Member

@jstarry jstarry commented Jul 16, 2021

Problem

Need a new message format for processing transactions that load accounts from an on-chain address map. Also need a way to differentiate this new message from the legacy transaction message format.

Summary of Changes

  • Introduce VersionedMessage which has custom serialization to determine which message version to deserialize by inspecting the first byte.
  • Add v0::Message which supports address maps and is serialized with version == 0

Fixes #

@jstarry jstarry force-pushed the versioned-message branch 4 times, most recently from 4636482 to 00944eb Compare July 16, 2021 21:14
@jstarry jstarry requested review from ryoqun and sakridge July 17, 2021 00:50
@codecov
Copy link

codecov bot commented Jul 17, 2021

Codecov Report

Merging #18725 (5ad1a3d) into master (db40cb4) will decrease coverage by 0.0%.
The diff coverage is 79.7%.

@@            Coverage Diff            @@
##           master   #18725     +/-   ##
=========================================
- Coverage    82.9%    82.9%   -0.1%     
=========================================
  Files         450      453      +3     
  Lines      128342   128686    +344     
=========================================
+ Hits       106429   106705    +276     
- Misses      21913    21981     +68     

@jstarry jstarry requested a review from jackcmay July 17, 2021 21:09
pub num_readonly_signed_accounts: u8,
pub num_readonly_unsigned_accounts: u8,
#[serde(with = "short_vec")]
pub account_keys: Vec<Pubkey>,
Copy link
Member

Choose a reason for hiding this comment

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

the duplication here is unfortunate

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed, I spent a fair bit of time trying to "peek" at the first element to avoid this but couldn't get to a good solution. I'll add a comment in the Message struct pointing to this code.

@stale
Copy link

stale bot commented Jul 30, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale [bot only] Added to stale content; results in auto-close after a week. label Jul 30, 2021
@jstarry jstarry force-pushed the versioned-message branch from 2e0e1be to ed480df Compare August 7, 2021 17:04
@stale stale bot removed the stale [bot only] Added to stale content; results in auto-close after a week. label Aug 7, 2021
@jstarry jstarry force-pushed the versioned-message branch 2 times, most recently from 59b24ac to 37db41b Compare August 7, 2021 22:17
@jstarry
Copy link
Member Author

jstarry commented Aug 8, 2021

Any other concerns here before merging? I have changes ready that build on this

@jstarry
Copy link
Member Author

jstarry commented Aug 9, 2021

@mvines any high level feedback on this?

Copy link
Member

@mvines mvines left a comment

Choose a reason for hiding this comment

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

lgtm, all I have is a nit about the usage of the term "original"

mvines
mvines previously approved these changes Aug 9, 2021
@jstarry jstarry added the automerge Merge this Pull Request automatically once CI passes label Aug 9, 2021
@mergify mergify bot dismissed mvines’s stale review August 9, 2021 18:39

Pull request has been modified.

@mergify mergify bot removed the automerge Merge this Pull Request automatically once CI passes label Aug 9, 2021
@mergify
Copy link
Contributor

mergify bot commented Aug 9, 2021

automerge label removed due to a CI failure

@jstarry jstarry force-pushed the versioned-message branch from a433974 to fa2df7e Compare August 9, 2021 19:37
@jstarry jstarry added the automerge Merge this Pull Request automatically once CI passes label Aug 9, 2021
@mergify mergify bot removed the automerge Merge this Pull Request automatically once CI passes label Aug 9, 2021
@mergify
Copy link
Contributor

mergify bot commented Aug 9, 2021

automerge label removed due to a CI failure

@jstarry jstarry added the automerge Merge this Pull Request automatically once CI passes label Aug 9, 2021
@mergify mergify bot removed the automerge Merge this Pull Request automatically once CI passes label Aug 9, 2021
@mergify
Copy link
Contributor

mergify bot commented Aug 9, 2021

automerge label removed due to a CI failure

@jstarry jstarry force-pushed the versioned-message branch from 92d0e55 to 5ad1a3d Compare August 9, 2021 23:06
@jstarry jstarry added the automerge Merge this Pull Request automatically once CI passes label Aug 9, 2021
@mergify mergify bot removed the automerge Merge this Pull Request automatically once CI passes label Aug 10, 2021
@mergify
Copy link
Contributor

mergify bot commented Aug 10, 2021

automerge label removed due to a CI failure

@jstarry jstarry merged commit 8817f59 into solana-labs:master Aug 10, 2021
@jstarry jstarry deleted the versioned-message branch August 10, 2021 05:03
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.

4 participants