-
Notifications
You must be signed in to change notification settings - Fork 224
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
Introducing calltable serialization to TransactionV1
structures subtree.
#4823
Merged
casperlabs-bors-ng
merged 1 commit into
casper-network:feat-2.0
from
zajko:transaction_serialization_protocol
Sep 10, 2024
Merged
Introducing calltable serialization to TransactionV1
structures subtree.
#4823
casperlabs-bors-ng
merged 1 commit into
casper-network:feat-2.0
from
zajko:transaction_serialization_protocol
Sep 10, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
da19e00
to
ea4442b
Compare
6897039
to
d4f05d0
Compare
zajko
commented
Aug 16, 2024
@@ -660,10 +660,10 @@ fn faucet_costs() { | |||
// This test will fail if execution costs vary. The expected costs should not be updated | |||
// without understanding why the cost has changed. If the costs do change, it should be | |||
// reflected in the "Costs by Entry Point" section of the faucet crate's README.md. | |||
const EXPECTED_FAUCET_INSTALL_COST: u64 = 160_878_698_504; | |||
const EXPECTED_FAUCET_INSTALL_COST: u64 = 160_967_026_637; |
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.
The gas values changed here because:
- A new public function was introduced in
types
(allocate_buffer_for_size
) - InitiatorAddr is used and passed to the engine and it's serialization schema changed
d4f05d0
to
00f132d
Compare
TransactionV1
type subtree bas…TransactionV1
structures subtree.
0c6e7e7
to
dfeb2bf
Compare
darthsiroftardis
approved these changes
Sep 5, 2024
dfeb2bf
to
b87f1b3
Compare
EdHastingsCasperAssociation
approved these changes
Sep 10, 2024
bors r+ |
Build succeeded: |
e6456b7
into
casper-network:feat-2.0
3 checks passed
This was referenced Nov 23, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an extension to the
bytesrepr
serialization used in the rest of the node and it also uses theFromBytes
andToBytes
traits.From now on selected types will use a specific serialization approach which will be called "calltable" serialization.
A "calltable-serialized" type is serialized as follow:
u16
index to each of the structs attribute. The assumption is that the indexes are 0-basedToBytes
implementation, producing binary payloads: binary_vec0, binary_vec1, ..., binary_vecN-1. We don't allow any of the binary_veci to be empty.
field0 = Field {
index: 0
offset: 0
}
fieldi = Field {
index: i
offset: fieldi - 1.offset + length(binary_veci - 1)
}
CalltableSerializationEnvelope {fields, bytes}
and serialize it using it'sToBytes
implementation.u8
unique index for each of the variant. The variant-index should start from 0 and be contiguous.u16
index to each of the enum variants attribute. The assumption is that the indexes are 1-based.nary_vecN). We don't allow any of the binary_veci to be empty.
field0 = Field {
index: 0
offset: 0
}
fieldi = Field {
index: i
offset: fieldi - 1.offset + length(binary_veci - 1)
}
CalltableSerializationEnvelope {fields, bytes}
and serialize it using it'sToBytes
implementation.struct
, but we prepend a syntheticu8
field which identifies the variant.This PR applies calltable serialization to the following types:
InitiatorAddr
enumPricingMode
enumTransactionEntryPoint
enumTransactionInvocationTarget
enumTransactionScheduling
enumTransactionTarget
enumTransactionV1
structTransactionV1Body
structTransactionV1Header
structAll other types (especially legacy ones, including those nested in "calltable-serialized" types) should use "regular" serialization logic.