-
Notifications
You must be signed in to change notification settings - Fork 1k
Adding a shielding fee for normal shielding txs. #4726
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Tomas Zemanovic <[email protected]>
crates/tx/src/section.rs
Outdated
/// Wrap a header with a section for the purposes of computing hashes | ||
Header(Header), | ||
/// The account paying the fee for a shielding transaction | ||
ShieldingFee { |
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.
Quick idea I haven't reasoned too deeply about (especially in terms of safety): would it be possible to avoid this new section type and encode all the necessary data directly inside the Transfer
data section? Maybe we could just add two entires: the fee payer as a source and the PGF account as the target. The multitransfer
function will just update the balances accordingly. The masp vp should have all the necessary data to check if the PGF account has been credited the fees when the vector of inputs of the transparent bundle is non-empty. It should also be able to verify that the amount credited to the PGF account is in a supported token and matches the expected amount for that token
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.
The difficult part would be knowing which masp tx was paid for it multiple shields are in a batch. We need a commitment.
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.
@grarco I'm doing something similar in the FMD PR I have open
namada/crates/token/src/lib.rs
Lines 185 to 186 in e8b2722
/// Pointers to MASP data within a transfer tx | |
pub shielded_data: Option<MaspTxData>, |
namada/crates/core/src/masp.rs
Lines 112 to 122 in e8b2722
pub struct MaspTxData { | |
/// Id of the MASP transaction. | |
/// | |
/// This is used to look-up a MASP transaction section. | |
pub masp_tx_id: MaspTxId, | |
/// Section hash of the FMD flag ciphertext. | |
/// | |
/// This is used to look-up a transaction data section | |
/// containing an FMD flag ciphertext. | |
pub flag_ciphertext_sechash: Hash, | |
} |
the fmd section is stored in
Section::ExtraData
, thus is implicitly signed when we sign the tx_transfer
data
this still breaks the hw wallet tho, I think, because the parsing of the masp tx data section is now different (the field is larger). it def did in the fmd pr
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.
9f91824
to
41cda8f
Compare
Let's get some new reviews here |
Describe your changes
Closes #4716
Checklist before merging
breaking::
labelsnamada-docs
reponamada-indexer
ornamada-masp-indexer
, a corresponding PR is opened in that repo