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
serialization: free function DSL #9195
serialization: free function DSL #9195
Conversation
Use free functions to do serialization in-place. Simplifies code, reduces binary size, and reduces copying. Depends on monero-project#9195 and monero-project#9194
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.
LGTM.
If you add a comment to your PR first post with an example, that would make it much better. I followed the discussion in Koe's repo, and these comments [1] look nice. Maybe a shorter version of these comments, in the commit message or your PR page would improve it.
The case I am thinking about is: that later when someone runs a git-blame or looks at this PR page, comments/explanations should be obvious.
Example usage for Seraphis types (in global or `sp` namespace): ``` BEGIN_SERIALIZE_OBJECT_FN(sp::SpCoinbaseEnoteCore) FIELD_F(onetime_address) VARINT_FIELD_F(amount) END_SERIALIZE() BEGIN_SERIALIZE_OBJECT_FN(sp::SpEnoteCore) FIELD_F(onetime_address) FIELD_F(amount_commitment) END_SERIALIZE() ```
3c46a56
to
2a2da79
Compare
Use free functions to do serialization in-place. Simplifies code, reduces binary size, and reduces copying. Depends on monero-project#9195 and monero-project#9194
Okay I promise after this and the BulletproofPlus2Proof PR I'll stop bitching about the tx class format. * Replace `rct::clsag` with `LegacyClsagProof`, which is `rct::clsag` without `I` field * Remove bin config fields and generator seed from `SpMembershipProofV1` * Add `SemanticConfigSpRefSetV1 get_sp_ref_set_config(tx_version_t)` method to `TxValidationContext` * Add `validate_tx_sp_ref_set_semantics` validator impl free function * Add `tx_version_from(const SpTxType&)` validator impl free function * Make `TxValidationContextMock` bound to a specific `SemanticConfigSpRefSetV1` * Direct serialization Depends on monero-project#9195 and monero-project#9194
Okay I promise after this and the BulletproofPlus2Proof PR I'll stop bitching about the tx class format. * Replace `rct::clsag` with `LegacyClsagProof`, which is `rct::clsag` without `I` field * Remove bin config fields and generator seed from `SpMembershipProofV1` * Add `SemanticConfigSpRefSetV1 get_sp_ref_set_config(tx_version_t)` method to `TxValidationContext` * Add `validate_tx_sp_ref_set_semantics` validator impl free function * Add `tx_version_from(const SpTxType&)` validator impl free function * Make `TxValidationContextMock` bound to a specific `SemanticConfigSpRefSetV1` * Direct serialization Depends on monero-project#9195 and monero-project#9194
Okay I promise after this and the BulletproofPlus2Proof PR I'll stop bitching about the tx class format. * Replace `rct::clsag` with `LegacyClsagProof`, which is `rct::clsag` without `I` field * Remove bin config fields and generator seed from `SpMembershipProofV1` * Add `SemanticConfigSpRefSetV1 get_sp_ref_set_config(tx_version_t)` method to `TxValidationContext` * Add `validate_tx_sp_ref_set_semantics` validator impl free function * Add `tx_version_from(const SpTxType&)` validator impl free function * Make `TxValidationContextMock` bound to a specific `SemanticConfigSpRefSetV1` * Direct serialization Depends on monero-project#9195 and monero-project#9194
Upstreaming UkoeHB#32