Supporting partially parsed transactions #9028
conradoplg
started this conversation in
Brainstorming
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Since we store blocks headers and transactions in serialized form in the database, we need to deserialize them in many situations.
However, deserialization is currently relatively expensive. This is because we go from bytes to fully semantic objects like Proofs and PublicKeys. However, deserializing those can be expensive; for example, deserializing public keys can require a point decompression since only the X coordinate and the sign of the Y coordinate are serialized. But in many situations we don't need the fully semantic objects.
To address this, we could introduce types like
PartiallyParsed(BlockHeader|Transaction)
which includes all the stuff that is cheap to deserialize but keeps the expensive stuff in serialized form. (Also a good idea to benchmark deserialization to pinpoint which fields are truly expensive to decode.) A method could be introduced to convert that to a fully parsed BlockHeader/Transaction if needed.The nice thing is that we could introduce those and slowly migrate to using them where it makes sense, but we don't need to do all at once.
Beta Was this translation helpful? Give feedback.
All reactions