Skip to content
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

seraphis_main: add validation helpers for legacy txs #37

Draft
wants to merge 26 commits into
base: seraphis_lib
Choose a base branch
from

Conversation

jeffro256
Copy link

@jeffro256 jeffro256 commented Mar 4, 2024

No description provided.

@UkoeHB
Copy link
Owner

UkoeHB commented Mar 5, 2024

Can you explain what the 'fork dependent' part is about and why it's necessary?

@jeffro256
Copy link
Author

jeffro256 commented Mar 5, 2024

cryptonote::transaction does not contain any explicit semantic rule reference inside the transaction, like SpTxSquashedV1 and SpTxCoinbaseV1 do. Instead, most of the static verification rules require a cryptonote fork version parameter to verify against (for example https://github.com/monero-project/monero/blob/7b7958bbd9d76375c47dc418b4adabba0f0b1785/src/cryptonote_basic/cryptonote_format_utils.cpp#L966). The new function validate_tx_semantics_fork_dependent<>() designates a spot for rule validation which depends on the cryptonote fork version, which will be used for legacy tx validation in the future.

An alternative approach would be to create a versioning framework for legacy txs, then infer the semantics rule version based on the content of the transactions, then simply use is_tx_version_allowed(), but that would make review work much harder IMO.

(This PR doesn't yet actually change any behavior)

@UkoeHB
Copy link
Owner

UkoeHB commented Mar 5, 2024

Ok, can you add a brief comment somewhere in this PR with what you just said?

UkoeHB and others added 23 commits March 6, 2024 02:44
…is_lib_hist_05_15_23 branch for commit history
make JamtisDestinationV1 serializable 

---------

Co-authored-by: DangerousFreedom <monero-inflation-checker@protonmail.com>
* add operator== to JamtisPaymentProposals

---------

Co-authored-by: DangerousFreedom <monero-inflation-checker@protonmail.com>\
* make JamtisPaymentProposal serializable

---------

Co-authored-by: DangerousFreedom <monero-inflation-checker@protonmail.com>
…tProposals (monero-project#24)

* modify construct_tx_for_mock_ledger_v1 so it outputs the JamtisPaymentProposals

---------

Co-authored-by: DangerousFreedom <monero-inflation-checker@protonmail.com>
* derive view_balance from master key

Co-authored-by: UkoeHB <37489173+UkoeHB@users.noreply.github.com>

---------

Co-authored-by: DangerousFreedom1984 <monero-inflation-checker@protonmail.com>
Co-authored-by: UkoeHB <37489173+UkoeHB@users.noreply.github.com>
@UkoeHB
Copy link
Owner

UkoeHB commented Mar 7, 2024

Needs rebase

@jeffro256 jeffro256 marked this pull request as draft March 11, 2024 22:51