-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Store versioned transactions in the ledger, disabled by default #19139
Conversation
ed19033
to
4c035f9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got through all of the sdk/*
stuff with this pass. Looking great so far! If you want to go ahead and push your outstanding conflict resolution changes, I'll take a crack at the plumbing on Monday
3d0daec
to
1ee709f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this round I reviewed the new commits and skimmed the plumbing. Looks great! Thanks for addressing the first round.
r+ conflict resolution
let sanitized_msg = Self::Legacy(message); | ||
if sanitized_msg.has_duplicates() { | ||
return Err(SanitizeMessageError::DuplicateAccountKey); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fyi @t-nelson I just added this forgotten dupe check which is currently inconsequential but could have caused issues later
Problem
Ledger cannot store versioned transactions
Summary of Changes
Most of the following changes are groundwork needed for enabling the processing of the new versioned transactions and aren't too interesting:
SanitizedTransaction
andSanitizedMessage
over the legacy versions since these new structs will wrap both legacy and versioned transactions and messages, respectively.The most significant changes in this PR are in
solana-sdk
and involve:MappedMessage
struct which wraps the new v0 message along with a list of its mapped messages. This struct provides methods to retrieve the full list of message accounts (including the accounts loaded by mapped addresses).SanitizedMessage
struct which wraps the legacyMessage
and the newMappedMessage
and adopts a large portion of the legacyMessage
for compatibility across the runtime.VersionedMessage
which mirror some of the legacyMessage
methods used for verification and hashing before the message is sanitized.SanitizedTransaction
struct which has now replaced the majority of the usages of legacyTransaction
across the runtime.VersionedTransaction
struct which is what is now serialized into each ledgerEntry
instead of legacy transactions. It has a small API since it has limited usage before the runtime converts it into aSanitizedTransaction
Feature Gate Issue: #24047