Skip to content

Commit

Permalink
Merge branch 'grarco/masp-vp-expiration' (#2375)
Browse files Browse the repository at this point in the history
* origin/grarco/masp-vp-expiration:
  Changelog #2375
  MASP vp validates tx expiration
  • Loading branch information
brentstone committed Jan 12, 2024
2 parents 3ac3e65 + 12b0324 commit 0b5109f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
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 @@ -375,6 +375,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

0 comments on commit 0b5109f

Please sign in to comment.