-
Notifications
You must be signed in to change notification settings - Fork 64
apollo_storage: invoke backward compitability #11952
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
apollo_storage: invoke backward compitability #11952
Conversation
|
Artifacts upload workflows: |
65b9223 to
ac5b92b
Compare
|
Not sure whether it's better with or without that here Code quote: // NOTE: InvokeTransactionV3 has a custom StorageSerde impl below for backward compatibility
// (handling transactions stored before the proof_facts field was added) |
|
@ShahakShama - this PR is only relevant if we need to read previously saved txs. Do you know if we ever try reading those? If not, perhaps we don't need this PR |
ac5b92b to
f132973
Compare
f132973 to
193966d
Compare
dan-starkware
left a comment
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.
@dan-starkware made 3 comments.
Reviewable status: 0 of 2 files reviewed, 2 unresolved discussions (waiting on @noaov1 and @ShahakShama).
a discussion (no related file):
Consider fixing typo in commit message (compitability)
crates/apollo_storage/src/serialization/serializers.rs line 1340 at r2 (raw file):
// NOTE: This is a temporary migration shim. Once all nodes have re-synced (i.e., no stored // transactions exist in the old format), remove this impl and move InvokeTransactionV3 back // to `auto_storage_serde_conditionally_compressed!`.
Add corresponding TODO
Code quote:
// NOTE: This is a temporary migration shim. Once all nodes have re-synced (i.e., no stored
// transactions exist in the old format), remove this impl and move InvokeTransactionV3 back
// to `auto_storage_serde_conditionally_compressed!`.crates/apollo_storage/src/serialization/serializers.rs line 1394 at r2 (raw file):
// Backward compatibility: proof_facts may not exist in old transactions. // If there's no more data, default to empty ProofFacts. let proof_facts = ProofFacts::deserialize_from(data).unwrap_or_default();
This will silently default to empty ProofFacts if deserialization fails for ANY reason, including corrupted data.
In general, a safer approach would be to only default on empty data (legacy format) and propagate actual errors.
For a "temporary migration shim" I think unwrap_or_default() approach is pragmatic and fine for this case.
193966d to
1e65643
Compare
avivg-starkware
left a comment
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.
@avivg-starkware made 2 comments.
Reviewable status: 0 of 2 files reviewed, 2 unresolved discussions (waiting on @noaov1 and @ShahakShama).
crates/apollo_storage/src/serialization/serializers.rs line 1340 at r2 (raw file):
Previously, dan-starkware wrote…
Add corresponding TODO
Added
crates/apollo_storage/src/serialization/serializers.rs line 1394 at r2 (raw file):
Previously, dan-starkware wrote…
This will silently default to empty
ProofFactsif deserialization fails for ANY reason, including corrupted data.
In general, a safer approach would be to only default on empty data (legacy format) and propagate actual errors.
For a "temporary migration shim" I thinkunwrap_or_default()approach is pragmatic and fine for this case.
Thanks! I updated this so we only default when no data remains, allowing other deserialization errors to be surfaced.
1e65643 to
8abeefb
Compare
avivg-starkware
left a comment
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.
@avivg-starkware resolved 1 discussion.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @noaov1 and @ShahakShama).
noaov1
left a comment
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.
@noaov1 reviewed 2 files and all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ShahakShama).
avivg-starkware
left a comment
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.
@avivg-starkware resolved 1 discussion.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @ShahakShama).

No description provided.