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

MASP vp expiration #2375

Merged
merged 2 commits into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changelog/unreleased/improvements/2375-masp-vp-expiration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- The MASP VP now validates the tx expiration.
([\#2375](https://github.com/anoma/namada/pull/2375))
8 changes: 8 additions & 0 deletions shared/src/ledger/native_vp/masp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,14 @@ where
) -> Result<bool> {
let epoch = self.ctx.get_block_epoch()?;
let (transfer, shielded_tx) = self.ctx.get_shielded_action(tx_data)?;

if u64::from(self.ctx.get_block_height()?)
> u64::from(shielded_tx.expiry_height())
{
tracing::debug!("MASP transaction is expired");
return Ok(false);
}

let transfer_amount = transfer
.amount
.to_amount(&transfer.token, &self.ctx.pre())?;
Expand Down
Loading