feat(db): add zstd compression to Transactions table#477
Merged
Conversation
Extract the envelope logic from `ReceiptEnvelope` into a generic `Envelope<T>` parameterized by an `EnvelopePayload` trait. Apply the same zstd compression to the `Transactions` table via `TxEnvelope`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #477 +/- ##
==========================================
- Coverage 73.32% 68.54% -4.78%
==========================================
Files 209 281 +72
Lines 23132 34394 +11262
==========================================
+ Hits 16961 23577 +6616
- Misses 6171 10817 +4646 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
zstd compression to Transactions table
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace ad-hoc CodecError string formatting with a typed EnvelopeError that covers each failure mode: incomplete header, unsupported version, unsupported encoding, serialize/deserialize, zstd compress/decompress, and legacy decode. EnvelopeError converts into CodecError at the Compress/Decompress trait boundary. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or 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
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.
Extracts the envelope logic introduced in #465 for
ReceiptEnvelopeinto a genericEnvelope<T>parameterized by anEnvelopePayloadtrait, then applies the same zstd compression to theTransactionstable via a newTxEnvelopetype alias.Each payload type supplies a 4-byte magic (
KRCPfor receipts,KTXNfor transactions), a human-readable name for error messages, and afrom_legacy_bytesfunction for backward-compatible deserialization of pre-envelope rows. The sharedCompress/Decompressimpls handle the header, zstd encode/decode, version/encoding validation, and legacy fallback.The
Transactionstable value type changes fromVersionedTxtoTxEnvelope. Existing uncompressed rows are transparently decoded via the legacy fallback inVersionedTx::from_legacy_bytes, so no migration is needed. However, any code that reads directly from theTransactionstable outside of the provider (eg. custom tooling) will need to update to handleTxEnvelopeinstead of bareVersionedTx.🤖 Generated with Claude Code